Good to get and print the external function variable a
def outer(): a = 1 def inner(): print a
You can also get an external array of a functions and add something
def outer(): a = [] def inner(): a.append(1) print a
However, this caused some problems when I tried to increase the integer:
def outer(): a = 1 def inner(): a += 1
Why is this happening and how can I achieve my goal (increase an integer)?
source share