return 那里不太懂
def f1(x):
return x*x
def new_fn(f):
def fn(x):
print('call '+f.__name__ + '()')
return f(x)
return fn
g1=new_fn(f1)
print(g1(5))
代码里面 return f(x)是退出def fn(x)么,这里的return是干嘛的
def f1(x):
return x*x
def new_fn(f):
def fn(x):
print('call '+f.__name__ + '()')
return f(x)
return fn
g1=new_fn(f1)
print(g1(5))
代码里面 return f(x)是退出def fn(x)么,这里的return是干嘛的
2016-05-29
举报