can we append a list with another list in Python ?
Zero Piraeus
schesis at gmail.com
Tue Oct 23 04:56:02 EDT 2012
:
On 23 October 2012 03:36, inshu chauhan <insideshoes at gmail.com> wrote:
> can we append a list with another list in Python ? using the normal routine
> syntax but with a for loop ??
The standard way to append the contents of one list to another is list.extend:
>>> a = [1, 2, 3]
>>> b = [4, 5, 6]
>>> a.extend(b)
>>> a
[1, 2, 3, 4, 5, 6]
... but I'm not sure what you mean by "... with a for loop"?
-[]z.
More information about the Python-list
mailing list