Sorry.

I meant for example:
list1 = [1,2,3]
list2 = [3,4,5]

newList = list1 + list2

versus

for x in list2:
    list1.append(x)

Which is the preferred way to add elements from one list to another?

On Sun, May 4, 2014 at 7:36 AM, Dave Angel <da...@davea.name> wrote:
> C Smith <illusiontechniq...@gmail.com> Wrote in message:
>>
>>
> I had always assumed that append() was more efficient, but some recent 
> discussions seem to point at that it is the same as append(). Which is 
> preferable and why?
>
> Please be more explicit,  preferably with example code.
>  list.append and list.__add__ don't even do the same thing.
>  Perhaps you mean list.extend
>
> I would also encourage you to properly use text mail to post,  as
>  there are a number of problems triggered by html mails as you're
>  doing now. Most of them don't matter with your current message,
>  however.
>
> --
> DaveA
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to