Hameed U. Khan wrote:

This else is the part of the for loop. And the statements in this else will be executed if your for loop will complete all of its iterations. if you want this else with 'if' statement then remove the for loop.



for instance:

looking_for = 11

for i in range(0,10):
    if i == looking_for:
        handle_it(i)
        break
else:
    print "Did not find", looking_for
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to