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
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
Comment