Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42442

Re: Help please

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.032
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'initialize': 0.07; 'subject:Help': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'guessing': 0.16; 'integer.': 0.16; 'loop.': 0.16; 'zero,': 0.16; 'wrote:': 0.18; 'integer': 0.24; 'mon,': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'subject:please': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'positive': 0.37; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'dangerous': 0.60; 'first': 0.61; 'guarantee': 0.63; 'honest': 0.78; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=GwbvGMmUqgkZXqWqJIr6EfExwQBKwyT7p6QUlDAFuhw=; b=E5+2xWq7sWzhdvGK580uS4eYU2G1Ml+gaTeqqjEMdfPdyEKhAb3aszP86Uao09hkbN msEk99UJLBzpLC0WqvGDwDQav0IpPA9mYAya4F4DvvcH96H7TmOjfNC9Tx6J/0ntVB8B xT/qIsCe8iPd/nvrK6kktwE/xDMRs5xRwSah+j3lJmDAImtXlQQVSRiiZXOBxpwBxchA RuWBbh7rWVmhuhgI66mubMyBqqETzSxNRePVTOZnT4lekdgXZtatmDxp0umzWCtLAaWl uescu7VV4j+5bqUo6icO3fXVDJwmPoyQYhVTCHgYC55vnfnc0ox91Q5dSl12UTgm1SIS n6tw==
MIME-Version 1.0
X-Received by 10.220.231.199 with SMTP id jr7mr8056813vcb.70.1364793892872; Sun, 31 Mar 2013 22:24:52 -0700 (PDT)
In-Reply-To <61cf6de1-179e-4d3d-8083-a2f34b144cd1@googlegroups.com>
References <61cf6de1-179e-4d3d-8083-a2f34b144cd1@googlegroups.com>
Date Mon, 1 Apr 2013 16:24:52 +1100
Subject Re: Help please
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4046.1364793902.2939.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364793902 news.xs4all.nl 6879 [2001:888:2000:d::a6]:44308
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42442

Show key headers only | View raw


On Mon, Apr 1, 2013 at 4:15 PM,  <khaosyt@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Help please khaosyt@gmail.com - 2013-03-31 22:15 -0700
  Re: Help please Chris Angelico <rosuav@gmail.com> - 2013-04-01 16:24 +1100
    Re: Help please khaosyt@gmail.com - 2013-03-31 22:41 -0700
      Re: Help please Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-02 00:09 +0000
    Re: Help please khaosyt@gmail.com - 2013-03-31 22:41 -0700

csiph-web