Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31922 > unrolled thread

Re: can we append a list with another list in Python ?

Started byZero Piraeus <schesis@gmail.com>
First post2012-10-23 04:56 -0400
Last post2012-10-23 04:56 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: can we append a list with another list in Python ? Zero Piraeus <schesis@gmail.com> - 2012-10-23 04:56 -0400

#31922 — Re: can we append a list with another list in Python ?

FromZero Piraeus <schesis@gmail.com>
Date2012-10-23 04:56 -0400
SubjectRe: can we append a list with another list in Python ?
Message-ID<mailman.2654.1350982586.27098.python-list@python.org>
:

On 23 October 2012 03:36, inshu chauhan <insideshoes@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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web