I am trying to run the below script:
i = 0
numbers = []
def number_includer(max_num):        
    while i < max_num:
        print "At the top i is %d" % i
        numbers.append(i)
        i = i + 1
        print "Numbers now: ", numbers
        print "At the bottom i is %d" % i
number_includer(7)
print "The numbers: "    
for num in numbers:
    print num
but when i simply do:
numbers = []
def number_includer(max_num):
    # Used i equals 0 inside the function here.
    i = 0
    while i < max_num:
        print "At the top i is %d" % i
        numbers.append(i)
        i = i + 1
        print "Numbers now: ", numbers
        print "At the bottom i is %d" % i
number_includer(7)
print "The numbers: "    
for num in numbers:
    print num
i don't want answer but an explanation, if the problem is with using a local variable inside def which is predefined on the outside, its got no problem with the list 'numbers' being global?
