Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; 'see.': 0.07; 'space.': 0.07; 'cc:addr:python-list': 0.10; 'concatenate': 0.16; 'intervening': 0.16; 'lhs': 0.16; 'relevant,': 0.16; 'tuple,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'skip:[ 10': 0.26; 'am,': 0.27; 'subject:list': 0.28; 'initial': 0.28; '>>>>': 0.29; 'no,': 0.29; 'subject: ?': 0.30; 'problem.': 0.32; 'list': 0.35; 'doing': 0.35; 'list.': 0.35; 'but': 0.36; 'subject:with': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'mean': 0.38; 'received:192': 0.39; 'space': 0.39; 'list,': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'dont': 0.64; 'equals': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'received:74.208.4.194': 0.84 Date: Thu, 25 Oct 2012 05:54:28 -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: inshu chauhan Subject: Re: can we append a list with another list in Python ? References: <901739839.1116059.1350990465261.JavaMail.root@sequans.com> <50890388.8030809@davea.name> <508906DF.1090804@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:dOxNDn0T3T6UWyOmfZ2pfIDLThc1esPqWjJXbyVjQiP cFFslUhBitswdh2voKjO1U1jkFIwNjLOXiUECc+VkFKRk/7wsH 2bLA1GhJC+ZvuLwuLERP6PqK/1/QI+wjLVIqI/vIpQ7WGdxu2+ IKhn2ptp76zYvTeSH3fUqB8K3ch73SWkqJbVevwKSY43ZI1hwt y3ujL03hX6xxfMNCA27SdFL2/jq9rvsQrZTa7UNP3Ff+wG5ttF 0ixiLqtea4a+x6sKbJ4fCG8NkbNCGR2F7RfEKaKFxDyWTLyROq S1F7FQvLld75ilBHns8oCyJZq6cpUAiCWP53vRl2ASmFlbZfg= = 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351158891 news.xs4all.nl 6943 [2001:888:2000:d::a6]:39779 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32105 On 10/25/2012 05:44 AM, inshu chauhan wrote: >>> >>>> or if the clist initial contents were relevant, perhaps you mean >>>> >>>>> clist += alist, blist >>>> >>> >>> But not this because it will simply concatenate the list like >>> [1,2,3,4,5,6] .. I dont want this actaully... >>> >>>> >> >> No, it won't. Try it to see > > > Ok but it should be clist + = [alist, blist ] ???? > >> >> >> -- >> >> DaveA >> > No, try it and see. a,b is a tuple, and [a,b] is a list. But if you're doing the +=, and the LHS is a list, then it'll work with any iterable. BTW, the extra space in your new line will also be a problem. The plus and the equals must be adjacent, without an intervening space. -- DaveA