Namespace issues...

cghost phreacker at aol.com
Sat Feb 14 05:59:27 EST 2004


i am very confused...why does the following script modify the global list "l":

l=[]

def x():
   l.append("xyz")

x()
print l

but the same script applied to a single variable doesnt..:

l="moe"

def x():
   l+="howdy"

x()
print l



More information about the Python-list mailing list