Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'string': 0.09; 'builtin': 0.09; 'input,': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Help': 0.11; 'stored': 0.12; 'question.': 0.14; 'bumping': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'storing': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'integer': 0.24; 'url:moin': 0.24; 'least': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'converting': 0.30; 'url:wiki': 0.31; 'probably': 0.32; 'url:python': 0.33; 'url:org': 0.36; 'list.': 0.37; 'handle': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; "you're": 0.61; "you'll": 0.62; 'email addr:gmail.com': 0.63; 'sum': 0.64; 'more': 0.64; 'charset:windows-1252': 0.65; 'hours': 0.66; 'subject': 0.69 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Help Date: Mon, 01 Apr 2013 23:09:04 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-92-18-43-197.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: X-Antivirus: avast! (VPS 130401-0, 01/04/2013), Outbound message X-Antivirus-Status: Clean 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364854047 news.xs4all.nl 6945 [2001:888:2000:d::a6]:34510 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42510 On 01/04/2013 22:42, khaosyt@gmail.com wrote: > Self-bump > It's considered polite to wait for at least 24 hours before bumping a question. You might have got more answers if you'd given a decent subject line rather than "Help". As it happens all you need do is loop around the string that is input, converting every digit to an integer and storing them in a list, then call the builtin sum function against the stored list. You'll probably also need a try/except to handle any duff input. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence