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


Groups > comp.lang.python > #32098

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

Date 2012-10-25 05:16 -0400
From Dave Angel <d@davea.name>
Subject Re: can we append a list with another list in Python ?
References (2 earlier) <CAN1F8qXzGO-pav3zrth40JBYNxfxF74ZDaGPnGfKnHZ37x7bYg@mail.gmail.com> <CAN1F8qWWTAoGM_A=V8qKJ9Cp23XiqYyn3ZdeejzB4PzK5djrZw@mail.gmail.com> <CAN1F8qVz7EbHNG5cBz_h7U=jrCp4p42cnT8mdtPuyaCEUYf63w@mail.gmail.com> <CAFqGZRE9P7RxjfR1jj316ozN39rXyWjQzz1yGThYB-vP=mKs1Q@mail.gmail.com> <CAFqGZREsGdQC-b2mGUqRESjfA38L2LJR1b_j62AHm66xwkxpvQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2818.1351156645.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 10/25/2012 05:04 AM, inshu chauhan wrote:
> Actually what I wanted to do is :
>
> suppose there are 3 lists :
>
> like for xample :
>
> clist = [] an empty list , alist = [1,2,3], blist = [4,5,6]
>
> and the I want the result is clist = [ [1,2,3], [4,5,6] ..]
>
> then I want to read all the lists in clist one by one
>
> like :
>
>  for item in clist:
>      print item
>
> which should print:
>
> [1,2,3]
> [4,5,6]
>
>

clist = alist, blist

or if the clist initial contents were relevant, perhaps you mean

clist += alist, blist



-- 

DaveA

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


Thread

Re: can we append a list with another list in Python ? Dave Angel <d@davea.name> - 2012-10-25 05:16 -0400

csiph-web