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 wlfr...@ix.netcom.comwrote: On Sun, 23 Aug 2009 10:04:57 -0500, Victor Subervi victorsube...@gmail.com declaimed the following in gmane.comp.python.general: Hi; I have the following: style = raw_input('What

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

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

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 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. What style is

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 mar...@letterboxes.orgwrote: 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