> A second question is: When can you use += vs .append().
> Are the two always the same?

They are never the same unless you only add one item to the list.
append() will only increase the length of a list by 1.

la = [1,2]
lb = [3, 4, 5]
la += lb
print la

lc = [1,2]
lc.append(lb)
print lc

--output:--
[1, 2, 3, 4, 5]
[1, 2, [3, 4, 5]]


print la[2]
print lc[2]

--output:--
3
[3, 4, 5]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to