Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '[1,': 0.09; 'subject:number': 0.09; 'subject:How': 0.10; 'cc:addr:python- list': 0.11; '"does': 0.16; '-tkc': 0.16; '1234': 0.16; 'constitutes': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'folks': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'specify': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; "i'm": 0.30; 'work.': 0.31; 'code': 0.31; 'closer': 0.31; 'me?': 0.32; 'subject:from': 0.34; 'could': 0.34; 'but': 0.35; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'wrong': 0.37; 'does': 0.39; 'sure': 0.39; 'provide': 0.64; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'line,': 0.68; '128,': 0.84; 'received:50.22': 0.84 Date: Mon, 21 Jul 2014 15:26:25 -0500 From: Tim Chase To: fl Subject: Re: How to extract digit from a number? In-Reply-To: <12e1f726-c083-49db-86bd-1c9ae3151b2a@googlegroups.com> References: <12e1f726-c083-49db-86bd-1c9ae3151b2a@googlegroups.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: python-list@python.org 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405974457 news.xs4all.nl 2913 [2001:888:2000:d::a6]:48190 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74952 On 2014-07-21 13:14, fl wrote: > I see the following example on line, but it does not work. I do not > know what is wrong. Could you correct it for me? > > I'm not sure what [1, 1, 0, 0, 0, 0, ...] has to do with 128, but > if you want the base 10 digits: > > >>> a = 1234 > >>> [int(d) for d in str(a)] > >>> [1, 2, 3, 4] You don't specify *what* is wrong or what constitutes "does not work". If you provide an example of what you *do* want, folks here can help you get closer to the code you need to do what you intend. -tkc