Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; 'suppose': 0.07; 'tuple': 0.09; 'cc:addr:python-list': 0.10; 'alist': 0.16; 'mark.': 0.16; 'relevant,': 0.16; 'wrote:': 0.17; 'meant': 0.21; 'sorry,': 0.22; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'cc:addr:gmail.com': 0.27; 'subject:list': 0.28; 'initial': 0.28; 'loop,': 0.29; 'subject: ?': 0.30; 'lists': 0.31; 'print': 0.32; 'list': 0.35; 'there': 0.35; 'but': 0.36; 'wanted': 0.36; 'subject:with': 0.36; 'should': 0.36; 'too': 0.36; 'item': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'first': 0.61; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'angel': 0.93 Date: Thu, 25 Oct 2012 05:26:20 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: d@davea.name Subject: Re: can we append a list with another list in Python ? References: <901739839.1116059.1350990465261.JavaMail.root@sequans.com> <50890388.8030809@davea.name> In-Reply-To: <50890388.8030809@davea.name> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:UBu0XX9XhwWfVRs9/odkijZCLB4yWUW4MIvOqLp7aQb wAVXecSi+81vWiJY7vlAqisz6b3OzvURyYsMaqDGZKWcdUEo2a 3hXKCX+FcJS2KUeRsPHB+krX680NJyVl6VVMA26DGk1NISmYSV 2lA4IfTiL+4pkJ2BWJw/wzZg4BYIO+zvNKJzQooJqkVmXE54jo 5HlYcPzfGogpKflcZB9yKM2VDFIe8F8n9ok2TAhvZbY+fcVM19 twSsNGWMWv06uSUEJzhkFSx7tdLaEvu5ELmUPGDUmQgJ3zIhpo MipS4qFg1IymkDaNSrcZCMzDQcl2lvDxzHpMlEmO6l8N6qFlg= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351157207 news.xs4all.nl 6852 [2001:888:2000:d::a6]:43643 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32099 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