It\'s ok to get and print the outer function variable a
a
def outer(): a = 1 def inner(): print a
It\'s also ok
Workaround for Python 2:
def outer(): a = [1] def inner(): a[0] += 1 print a[0]