The following code gives the error UnboundLocalError: local variable 'Var1' referenced before assignment:
Var1 = 1
Var2 = 0
def function():
if Var2 == 0 and Var1 > 0:
print("Result One")
elif Var2 == 1 and Var1 > 0:
print("Result Two")
elif Var1 < 1:
print("Result Three")
Var1 =- 1
function()
How can I fix this? Thanks for any help!