# scope.py # Python has file level and local scope file = 0 def func1(): b = 5 # local scope print( b ) # print( file ) # can't do this because of the fact that # a local variable named file is going to be created in this function file = 2 # this is a local variable that shadows the file-level variable print(file) # if we didn't have the local variable, we could access the value of the file-levle # variable (just not assign to it) print( "file at top", file ) file = 1 print( "file at top 2 ", file ) func1() print( "file at top 3 ", file )