Re: Trying To Catch Invalid User Input

2009-08-24 Thread Victor Subervi
That's nice. Thanks! V On Sun, Aug 23, 2009 at 5:02 PM, Dennis Lee Bieber wrote: > On Sun, 23 Aug 2009 10:04:57 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > Hi; > > I have the following: > > > > style = raw_input('What style is this? (1 = short, 2 = long)

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Really slick! Thanks! V On Sun, Aug 23, 2009 at 11:08 AM, Albert Hopkins wrote: > On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > > Victor Subervi wrote: > > > Hi; > > > I have the following: > > > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > > flag = 0 > > > while

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > Victor Subervi wrote: > > Hi; > > I have the following: > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > flag = 0 > > while flag == 0: > > if (style != 1) or (style != 2): > > style = raw_input('There was a mistake.

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Gary Herron
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Re: Trying To Catch Invalid User Input

2009-08-23 Thread MRAB
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would think this would catch err