用普通函数和匿名函数作对比就能很容易发现匿名函数的作用
#普通函数 def add(a,b): return a + b print(add(2,3)) #匿名函数 add = lambda a,b : a + b print(add(2,3))
#普通函数 def add(a,b): return a + b print(add(2,3)) #匿名函数 add = lambda a,b : a + b print(add(2,3))
来源:https://www.cnblogs.com/hyxk/p/11372569.html