Something like this works fine:
try:
case = int(raw_input("enter a number less then 3 or more than 4: "))
except:
case = 0
while case <=2 or case >=5:
# do something to get out of loop
case += 1
print case
if case > 10: break
Notice that case is reserved keyword in C++, also notice that && isand || is or in Python. A simple & is bitwise and in C++ and Python.
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184