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 errors and permit valid values, but it
doesn't. If I enter an erroneous value the first time, and the second time a
good value, it doesn't break the loop. Why?
TIA,
Victor
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to