deftest_func(compute):
result = compute(1,2)# compute是函数print(type(compute))# print(result)return result
defcompute(x, y):return x + y
result = test_func(compute)print(result)
lambda匿名函数:只可临时使用一次
lambda 传入参数: 函数体(一行代码!!)
deftest_func(compute):
result = compute(1,2)print("result=", result)
test_func(lambda x, y: x + y)