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


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

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

Started byDaniel Fetchinson <fetchinson@googlemail.com>
First post2012-10-23 10:51 +0200
Last post2012-10-23 10:51 +0200
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 ? Daniel Fetchinson <fetchinson@googlemail.com> - 2012-10-23 10:51 +0200

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

FromDaniel Fetchinson <fetchinson@googlemail.com>
Date2012-10-23 10:51 +0200
SubjectRe: can we append a list with another list in Python ?
Message-ID<mailman.2653.1350982294.27098.python-list@python.org>
> can we append a list with another list in Python ? using the normal routine
> syntax but with a for loop ??

x = [1,2,3]
y = [10,20,30]
x.extend( y )
print x

this will give you [1,2,3,10,20,30] which I guess is what you want.

Cheers,
Daniel



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

[toc] | [standalone]


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


csiph-web