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:
Use a while-loop only to loop forever, and that means probably never. This only applies to Python, other languages are different.
I've googled all over this, referenced everything I can, but I can't find any reason in the world why this would be a convention in Python. What makes it different?
When I gave up programming 10 years ago, I was working in VB and would regularly be told to get rid of my For loops and use While loops instead. I was a hack (as I am today, though I wrote a LOT of code back then), so I just did what I was told without questioning it. Well, now I'm questioning it. Is this a speed issue? Is it just to avoid escape-less infinites?
forloop. Also see this: stackoverflow.com/questions/920645/…forloop in python and often you do need to know this when using awhileloop.forloops with generators, where you EXPLICITLY DO NOT KNOW how many elements are being iterated. Where's my -1 wrong moderation for comments when I need it? Python is NOT LIKE Java and C++, which you should know, given your rep score in Python tags.