def a():
b = 1
def x():
b -= 1
if something is something:
x()
a()
What im wanting here is to change b from a() in x()
I have tried using;
def a():
b = 1
def x():
global b
b -= 1
if something is something:
x()
a()
But this, as I expected, this told me global b is not defined.
b needs to change after x() is has run and if x() is called a second time b needs to be what x() set it to - 0 not what it was originally set to in a() - 1.