Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def newfunc(n):
  2. def myfunc(x):
  3. return x + n
  4. return myfunc
  5. new = newfunc(100)
  6. print(new)
  7.  
  8. <function newfunc.<locals>.myfunc at 0x000001FF3E5A0B70>
  9.  
  10. def newfunc(n):
  11. def myfunc(x):
  12. return x + n
  13. return myfunc
  14. new = newfunc(100)
  15. new(200)
  16.  
  17. def newfunc(n):
  18. def myfunc(x):
  19. return x + n
  20. return myfunc
  21. new = newfunc(100)
  22. print(new(100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement