In python, If you set the value of a variable inside the function, python understands it as a local variable with that name. Hence, you declared myVar1 inside the function the compiler read it as a local variable, thus the reason you are getting the error.
To avoid this error you may add global keyword in front of the variable inside the function.
Or you may pass parameters inside the function
def myFunction(myVar1, myVar2):
if myVar2 == 0 and myVar1 > 0:
print("This is the result of if block")
elif myVar1 == 1 and myVar1 > 0:
print("This is the result of elif block")
elif myVar1 < 1:
print("This is the result of another elif block")
myVar1 =- 1