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


Groups > comp.lang.python > #59247

Re: Some python newb help please?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'elif': 0.05; 'subject:help': 0.08; 'cc:addr:python-list': 0.11; '"if"': 0.16; '-tkc': 0.16; 'comparison.': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'value.': 0.19; 'input': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; 'statement': 0.30; 'subject:please': 0.30; 'charset:us-ascii': 0.36; 'subject:?': 0.36; "you're": 0.61; 'email addr:gmail.com': 0.63; 'to:addr:gmail.com': 0.65; 'lack': 0.78; 'fare': 0.84; 'received:50.22': 0.84
Date Tue, 12 Nov 2013 16:59:24 -0600
From Tim Chase <python.list@tim.thechases.com>
To lrwarren94@gmail.com
Subject Re: Some python newb help please?
In-Reply-To <22894a10-1ffd-4671-94f4-962dfb56e4fd@googlegroups.com>
References <f9bcd68d-ac00-421a-ade5-5f5690861d25@googlegroups.com> <mailman.2490.1384294935.18130.python-list@python.org> <22894a10-1ffd-4671-94f4-962dfb56e4fd@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 <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2496.1384297075.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384297075 news.xs4all.nl 15877 [2001:888:2000:d::a6]:47146
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59247

Show key headers only | View raw


On 2013-11-12 14:27, lrwarren94@gmail.com wrote:
>     if int(raw_input()) == 1:
>             print "Moving north"
>             y = y + 1
>     elif int(raw_input()) == 2:
>             print "Moving east"
>             x = x + 1
>     elif int(raw_input()) == 3:
>             print "Moving south"
>             y = y - 1
>     elif int(raw_input()) == 4:
>             print "Moving west"
>             x = x - 1
>     elif int(raw_input()) == 5:
>             print "Dost thou leave so soon? Fare thee well!"
>             quitCommand = 5
>     else:
>             print "I find your lack of reading comprehension skills
> disturbing."

Note that you're asking for input with each comparison.  Best to get
the input once and store it in a variable before the "if" statement
and then do the comparisons against the same value.

-tkc

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


Thread

Some python newb help please? lrwarren94@gmail.com - 2013-11-12 14:14 -0800
  Re: Some python newb help please? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-12 22:21 +0000
    Re: Some python newb help please? lrwarren94@gmail.com - 2013-11-12 14:27 -0800
      Re: Some python newb help please? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-12 22:54 +0000
      Re: Some python newb help please? MRAB <python@mrabarnett.plus.com> - 2013-11-12 22:56 +0000
        Re: Some python newb help please? lrwarren94@gmail.com - 2013-11-12 15:04 -0800
          Re: Some python newb help please? Chris Angelico <rosuav@gmail.com> - 2013-11-13 10:19 +1100
      Re: Some python newb help please? Tim Chase <python.list@tim.thechases.com> - 2013-11-12 16:59 -0600
      Re: Some python newb help please? Chris Angelico <rosuav@gmail.com> - 2013-11-13 09:58 +1100
      Re: Some python newb help please? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-12 20:49 -0500
  Re: Some python newb help please? John Strick <jstrickler@gmail.com> - 2013-11-12 14:49 -0800
  Re: Some python newb help please? Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-12 23:05 +0000

csiph-web