Re: Novice Issue

2013-04-18 Thread John Gordon
In <0fa050c1-3a00-4c17-9fa6-b79a22485...@googlegroups.com> Bradley Wright writes: > while raw_input != "quit" or "q": Others have pointed out flaws in this statement. However, even if you had written the loop the 'correct' way: user_input = raw_input() while user_input != "quit" or us

Re: Novice Issue

2013-04-18 Thread Bradley Wright
On Thursday, April 18, 2013 12:06:59 AM UTC-4, Bradley Wright wrote: > Good Day all, currently writing a script that ask the user for three things; > > 1.Name > > 2.Number > > 3.Description > > I've gotten it to do this hurah! > > > > print "Type \"q\" or \"quit\" to quit" > > while raw_inp

Re: Novice Issue

2013-04-18 Thread Dave Angel
On 04/18/2013 08:18 AM, Bradley Wright wrote: Secondly, thanks Wolfgang while raw_input not in ("quit", "q") - genius, i get your point clearly But you have to combine his point with Chris's, don't forget the parens on the call to raw_input. And if it were I, I'd also put a prompt

Re: Novice Issue

2013-04-18 Thread Bradley Wright
On Thursday, April 18, 2013 12:06:59 AM UTC-4, Bradley Wright wrote: > Good Day all, currently writing a script that ask the user for three things; > > 1.Name > > 2.Number > > 3.Description > > I've gotten it to do this hurah! > > > > print "Type \"q\" or \"quit\" to quit" > > while raw_inp

Re: Novice Issue

2013-04-18 Thread Mark Lawrence
On 18/04/2013 05:06, Bradley Wright wrote: Good Day all, currently writing a script that ask the user for three things; 1.Name 2.Number 3.Description I've gotten it to do this hurah! print "Type \"q\" or \"quit\" to quit" You've had a couple of answers already so I'll just point out that the

Re: Novice Issue

2013-04-18 Thread Chris Angelico
On Thu, Apr 18, 2013 at 6:58 PM, Wolfgang Maier 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 aga

Re: Novice Issue

2013-04-18 Thread Wolfgang Maier
Bradley Wright gmail.com> writes: > > Good Day all, currently writing a script that ask the user for three things; > 1.Name > 2.Number > 3.Description > I've gotten it to do this hurah! > > print "Type \"q\" or \"quit\" to quit" > while raw_input != "quit" or "q": > > print "" > name =

Re: Novice Issue

2013-04-17 Thread Chris Angelico
On Thu, Apr 18, 2013 at 2:06 PM, Bradley Wright wrote: > Good Day all, currently writing a script that ask the user for three things; > 1.Name > 2.Number > 3.Description > I've gotten it to do this hurah! > > print "Type \"q\" or \"quit\" to quit" > while raw_input != "quit" or "q": You'll want t