Novice Issue
Chris Angelico
rosuav at gmail.com
Thu Apr 18 05:06:08 EDT 2013
On Thu, Apr 18, 2013 at 6:58 PM, Wolfgang Maier
<wolfgang.maier at 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
More information about the Python-list
mailing list