2 ms·
Note - in python3 variable shadowing is much more controllable - in your example having modify_n look like: def modify_n(new_value): nonlocal n (an
by sophacles 11y ago
Note - in python3 variable shadowing is much more controllable - in your example having modify_n look like:
def modify_n(new_value):
nonlocal n
(and of course the print x -> print(x) changes), will result in 4,7,7