can we append a list with another list in Python ?

Adnan Sadzak sadzak at gmail.com
Tue Oct 23 05:10:42 EDT 2012


> ... but I'm not sure what you mean by "... with a for loop"?
>
>  -[]z.
>
>
Maybe this? :
-----
x = [1,2,3]
y = [10,20,30]
for z in y:
     x.append(z)

print x
-----

But list.extend should be right way.

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121023/f9611c92/attachment.html>


More information about the Python-list mailing list