Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43812
| References | <0fa050c1-3a00-4c17-9fa6-b79a22485c7a@googlegroups.com> <loom.20130418T104914-522@post.gmane.org> |
|---|---|
| Date | 2013-04-18 19:06 +1000 |
| Subject | Re: Novice Issue |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.758.1366275971.3114.python-list@python.org> (permalink) |
On Thu, Apr 18, 2013 at 6:58 PM, Wolfgang Maier
<wolfgang.maier@biologie.uni-freiburg.de> wrote:
> There are two solutions for that:
> the obvious: while not (raw_input == "quit" or raw_input == "q")
That has another problem: Once that's changed to raw_input() so it
actually requests input, it will do so twice, compare the first line
against "quit" and the second against "q", and proceed on that basis.
The membership test raw_input() in ("quit","q") is going to be far
better.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-17 21:06 -0700
Re: Novice Issue Chris Angelico <rosuav@gmail.com> - 2013-04-18 14:14 +1000
Re: Novice Issue Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-04-18 08:58 +0000
Re: Novice Issue Chris Angelico <rosuav@gmail.com> - 2013-04-18 19:06 +1000
Re: Novice Issue Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-18 11:10 +0100
Re: Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-18 05:18 -0700
Re: Novice Issue Dave Angel <davea@davea.name> - 2013-04-18 08:29 -0400
Re: Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-18 05:34 -0700
Re: Novice Issue John Gordon <gordon@panix.com> - 2013-04-18 14:21 +0000
csiph-web