can we append a list with another list in Python ?
Dave Angel
d at davea.name
Thu Oct 25 05:26:20 EDT 2012
More information about the Python-list mailing list
Thu Oct 25 05:26:20 EDT 2012
- Previous message (by thread): can we append a list with another list in Python ?
- Next message (by thread): can we append a list with another list in Python ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/25/2012 05:16 AM, Dave Angel wrote: > 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 > > > Sorry, i was too quick off the mark. I meant clist = [alist, blist] my first response would work with the loop, but it would have been a tuple of lists -- DaveA
- Previous message (by thread): can we append a list with another list in Python ?
- Next message (by thread): can we append a list with another list in Python ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list