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


Groups > comp.lang.python > #31921

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

References <CAFqGZRHGgN_tEinBku9cj78D_VawZgP3F8k5+FKen0mW3AeVbg@mail.gmail.com>
Date 2012-10-23 10:51 +0200
Subject Re: can we append a list with another list in Python ?
From Daniel Fetchinson <fetchinson@googlemail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2653.1350982294.27098.python-list@python.org> (permalink)

Show all headers | View raw


> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: can we append a list with another list in Python ? Daniel Fetchinson <fetchinson@googlemail.com> - 2012-10-23 10:51 +0200

csiph-web