在Python3.x中,我一下的程序为何不对呢?
from functools import reduce def log(func): def fn(): print ('call'+f.__name__+'()') return f(x) return fn @log def factorial(n): return reduce(lambda x,y:x*y range(1,n+1))#运行到这一行就出错了是为什么呢?错误提示为:invalid syntax
from functools import reduce def log(func): def fn(): print ('call'+f.__name__+'()') return f(x) return fn @log def factorial(n): return reduce(lambda x,y:x*y range(1,n+1))#运行到这一行就出错了是为什么呢?错误提示为:invalid syntax
2017-07-28
举报