Guest User

Untitled

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