函数也是一种对象 func = lambda x, y: x+y print func(3, 4) def func(x, y): return x+y print func(3, 4) 效果相同. 函数可以作为参数传递 def func(x, y): return x+y print func(3, 4) def test(f, a, b): print 'test' print f(a, b) test(func, 3, 4) def test(f, a, b): print 'test'…