Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def newfunc(n):
- def myfunc(x):
- return x + n
- return myfunc
- new = newfunc(100)
- print(new)
- <function newfunc.<locals>.myfunc at 0x000001FF3E5A0B70>
- def newfunc(n):
- def myfunc(x):
- return x + n
- return myfunc
- new = newfunc(100)
- new(200)
- def newfunc(n):
- def myfunc(x):
- return x + n
- return myfunc
- new = newfunc(100)
- print(new(100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement