函数嵌套返回值问题

>>> def a(x):
def b(y):
return x+y
return b

>>> a(1)(4)
5
>>> b
Traceback (most recent call last):
File "<pyshell#33>", line 1, in <module>
b
NameError: name 'b' is not defined

>>> a(1)
<function a.<locals>.b at 0x0000024F5F75EA60>

posted @ 2018-03-25 21:45  我们分头打钱!  阅读(578)  评论(0编辑  收藏  举报