Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; '[1,': 0.09; 'creighton': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'wed,': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'string': 0.17; 'first.': 0.18; 'laura': 0.18; 'url:home': 0.18; '>>>': 0.20; '2015': 0.20; 'sep': 0.22; 'header:X-Complaints-To:1': 0.26; '+0200,': 0.27; 'convert': 0.29; 'skip:> 10': 0.35; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us- ascii': 0.37; 'rather': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'results': 0.66; '>you': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Python, convert an integer into an index? Date: Tue, 22 Sep 2015 23:13:04 -0400 Organization: IISS Elusive Unicorn References: <201509222221.t8MMLMi5015927@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-68-178-61.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.20+ 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442977993 news.xs4all.nl 23769 [2001:888:2000:d::a6]:46232 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 2966 X-Received-Body-CRC: 3702764116 Xref: csiph.com comp.lang.python:97015 On Wed, 23 Sep 2015 00:21:22 +0200, Laura Creighton declaimed the following: > >You need to convert your results into a string first. > >result_int=1234523 >result_list=[] > >for digit in str(result_int): > result_list.append(int(digit)) > Rather wordy... >>> [int(i) for i in str(1234523)] [1, 2, 3, 4, 5, 2, 3] -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/