Guest User

Untitled

a guest
Oct 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. def make_counter():
  2. class local:
  3. count = 0
  4.  
  5. def next():
  6. local.count += 1
  7. return local.count
  8.  
  9. return next
  10.  
  11. c = make_counter()
  12. print(c())
  13. print(c())
  14. print(c())
  15. print(c())
Add Comment
Please, Sign In to add comment