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


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

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

Started byDave Angel <d@davea.name>
First post2012-10-23 09:13 -0400
Last post2012-10-23 09:13 -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 ? Dave Angel <d@davea.name> - 2012-10-23 09:13 -0400

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

FromDave Angel <d@davea.name>
Date2012-10-23 09:13 -0400
SubjectRe: can we append a list with another list in Python ?
Message-ID<mailman.2664.1350998546.27098.python-list@python.org>
On 10/23/2012 03:36 AM, inshu chauhan wrote:
> can we append a list with another list in Python ? using the normal routine
> syntax but with a for loop ??
>
>

To combine list a with list b, you can do any of:

c = a + b
a += b
a.extend(b)

Obviously, the first leaves a unmodified, while the other two modify it
in-place.



-- 

DaveA

[toc] | [standalone]


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


csiph-web