# scope3.py
b = 7
x = 30

def plop2 (b):
    print ("plop2")
    b = b + 5
    print (b)
    return b

def main ():
    a = 20
    i = 40
    a = [1,2]
    b = 12
    def plop (b):
        b = plop2(b)
        print ("plop")
        x = 0               
        i = 50
        for i in range (1,5):
            x = x + i        
        print ("i",i)           
        print ("a",a)          
        a[1] = 3          
        print ("b",b)        
        print ("x",x)
    plop(b)         	   
    print ("i",i)          
    print ("x",x)         
    print ("a",a)        
    print ("b",b)      

main()

#L - local, in the current def
#E - enclosed function (there's a def inside a def)
#G - global in module
#B - built-in in python

