Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'message- id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'them...': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; '>>>': 0.22; 'url:home': 0.24; 'header:X-Complaints-To:1': 0.27; 'them?': 0.31; 'list': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'name': 0.63; 'subject:via': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: generating unique variable name via loops Date: Tue, 04 Nov 2014 09:00:25 -0500 Organization: IISS Elusive Unicorn References: <8d3d202f-3bb8-4683-8dd7-b065fab06c34@googlegroups.com> <8df0b347-0569-4505-95f8-12baf44a1743@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: adsl-108-73-119-167.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415109642 news.xs4all.nl 2892 [2001:888:2000:d::a6]:57681 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80182 On Tue, 04 Nov 2014 18:49:14 +0630, Veek M declaimed the following: >Fatih Güven wrote: > >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: >>> I want to generate a unique variable name for list using python. >>> >>> list1=... >>> list2=... > >for x in range(1,10): > exec("list%d = []" % x) Of course, now that you have them... what can you do with them? Without scattering exec() calls all over the code. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/