On 7 November 2013 02:56, Alex Kleider <aklei...@sonic.net> wrote: > On 2013-11-06 01:52, Oscar Benjamin wrote: > >> >> I'll give one suggestion which is that to concatenate one list onto >> the end of another you would use the .extend() method rather than the >> .append() method. > > > What would be the advantage/disadvantage of what you suggest vs using the > plus (+) operand as in > l = l1 + l2 > ??
As Dave says l1 + l2 creates a new list. However l1 += l2 does the same as the extend method and mutates l1 in place. Oscar _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor