python scope of variables in with code example
Example 1: python variable scope
a = 5
def f1():
a = 2
print(a)
print(a) # Will print 5
f1() # Will print 2
Example 2: python variables
var = 640
number = 604
tr = 623
a = 5
def f1():
a = 2
print(a)
print(a) # Will print 5
f1() # Will print 2
var = 640
number = 604
tr = 623