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 && is
and || is
or in Python. A simple & is
bitwise and in C++ and Python.
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
Offline 1,422 posts
since Jul 2005