In this below code, why the variable 'a' is not defined if I call the function fun() but works if I use the if "True" condition and disable the function and its call.
print ("Hello world! ")
def fun():
#if True:
a = 20
print ("Inside this function")
print ("a is ", a)
print ("This is outside ")
fun()
print ("new val of a is ", a)
helloWorld.py", line 13, in print ("new val of a is ", a) NameError: name 'a' is not defined