someStuff = False
def spawn():
print(someStuff)
if( 3==4):
someStuff = True
while (someStuff==False):
spawn()
Here's the code, print(someStuff) does not work, it says "UnboundLocalError: local variable 'someStuff' referenced before assignment". However, if the if statement is taken out, then it works.