Why is the purpose of the “else” clause following a “for” or “while” loop?
I am a Python beginner. I find that the else in for–else and while–else is completely unnecessary. Because for and while will finally run to else, and we can use the usual lines instead. For example: for i in range(1, 5): print i else: print 'over' and for i in range(1, 5): print i print … Read more