Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'initialize': 0.07; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'python': 0.11; 'guessing': 0.16; 'integer.': 0.16; 'loop.': 0.16; 'zero,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'integer': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'subject:please': 0.30; "i'm": 0.30; 'please.': 0.31; 'monday,': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'positive': 0.37; 'pm,': 0.38; 'dangerous': 0.60; 'from:no real name:2**0': 0.61; 'first': 0.61; 'guarantee': 0.63; 'honest': 0.78; '2013': 0.98 X-Received: by 10.49.104.144 with SMTP id ge16mr679944qeb.19.1364794892534; Sun, 31 Mar 2013 22:41:32 -0700 (PDT) Newsgroups: comp.lang.python Date: Sun, 31 Mar 2013 22:41:32 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=74.109.22.141; posting-account=4W7nAAoAAABhu6jqNF1_LLkqm6-ij3Cw References: <61cf6de1-179e-4d3d-8083-a2f34b144cd1@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 74.109.22.141 MIME-Version: 1.0 Subject: Re: Help please From: khaosyt@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 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: , Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364794901 news.xs4all.nl 6952 [2001:888:2000:d::a6]:51589 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42445 On Monday, April 1, 2013 1:24:52 AM UTC-4, Chris Angelico wrote: > On Mon, Apr 1, 2013 at 4:15 PM, wrote: > > > integer = input("Enter a positive integer: ") > > > again = raw_input("Again? (Y/N): ") > > > > Okay, the first thing I'm going to say is: Don't use input() in Python > > 2. It's dangerous in ways you won't realize. Use int(raw_input(...)) > > for something like this, which will guarantee you an integer. > > > > I'm guessing this is homework. Please be honest about that; we'll help > > you learn but won't just give you the answers. > > > > All you need to do is initialize something to zero, and then keep > > adding 'number' onto it in the loop. You should be able to sort that > > out. > > > > ChrisA Elaborate, please.