主要用法如下:适用于比较小型的函数
fun = lambda x :x*x-x
print(fun(2))
结果:
F:\python下载\python.exe F:/python下载/practical/untitled1/wen_03.py
20
Process finished with exit code 0
def funa(x):
return x ** x
funb = lambda x :funa(x)**x
print(funb(3))
结果:
F:\python下载\python.exe F:/python下载/practical/untitled1/wen_03.py
19683
Process finished with exit code 0