学习lambda表达式之1


# f(x, y) = x + y
def f(x, y):
    return x + y
# g(x) = x +1
def g(x):
    return x +1
# 生成复合函数 h(x, y) = f(x, g(y))
def h(x, y):
    return f(x, g(y))
用lambda表达式写:
# f(x, y) = x + y
f = lambda x, y : x + y
# g(x) = x +1
g = lambda x : x + 1
# 生成复合函数 h(x, y) = f(x, g(y))
h = lambda x, y : f(x, g(y))