I am wondering if there is a way to exit the while loop before executing all of it...
For example:
stop=0
limit=5
while (stop < limit+1):
print "one"
stop=stop+1
print "two"
stop=stop+1
print "three"
stop=stop+1
print "four"
stop=stop+1
print "five"
stop=stop+1
print "six"
stop=stop+1
stop=stop+1
print "getting too close"
print "gone too far"
gives me an output of:
one two three four five six getting too close gone too far
How can I exit the while loop EXACTLY when "stop" and "limit" are equivalent in value?
Thanks for your help!

New Topic/Question
Reply




MultiQuote







|