Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # first attempt: explicit state
- def foo(x, state_mut):
- state_mut[0] += 1
- return x * 2
- state = [0] # initial state
- x = 3
- x1 = foo(x, state)
- print("x1 = {}, state = {}".format(x1, state))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement