I\'m about 2 weeks deep in my study of Python as an introductory language. I\'ve hit a point in Zed\'s \"Learn Python the Hard Way\" where he suggests:
Why avoid while loops? For training purposes. I quote from the book:
Never be a slave to the rules in real life. For training purposes you need to follow these rules to make your mind strong, but in real life sometimes these rules are just stupid. If you think a rule is stupid, try not using it.
The fact is that some of these rules are stupid all the time, in real life. Avoiding while loops is one. His rule for for loops is that you use them when there is a list (or tuple or generator) of elements to iterate over or a fixed number of iterations. This is correct. When there is not, and you instead have a certain state or condition you want to reach, you use while loops. Only using them when you have an infinite loop (like event handlers) is a stupid rule. But newbies tend to use them too often, maybe that's why he has the rule there.