You cannot do what you ask in a clean way. Nothing like a statement globalthat can help you. You need to encode it like this:
def outer():
x = 0
def inner(x):
return x + 1
x = inner(x)
This has the added benefit of explicitly indicating how data is transferred and exited from the function.
, x , .