我课程中的部分代码(除没写):
def f_add(a,b):
return a+b
def f_mul(a,b):
return a*b
def f_sub(a,b):
return a-b
def g1(f,a,b):
return f(a,b)
a,b,c,d = 1,2,3,4
print g1(f_sub, g1(f_mul, g1(f_add,a,b), c), d), g1(f_mul, g1(f_add,a,b), g1(f_sub,c, d))
对python感兴趣可以到这里了解一下:
study.163.com/course/courseMain.htm?courseId=1000035