Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def make_counter(start=0, step=1):
- def counter():
- return (start+step, make_counter(start=start+step, step=step))
- return counter
- twos = make_counter(start=10, step=2)
- curr, twos = twos()
- print(curr)
- curr, twos = twos()
- print(curr)
- curr, twos = twos()
- print(curr)
- curr, twos = twos()
- print(curr)
- curr, twos = twos()
- print(curr)
- curr, twos = twos()
- print(curr)
Add Comment
Please, Sign In to add comment