One of my teachers warned me not to use while
in python. It is really strange for me as I have not found any articles on why to do so. What do you think on what could the grounds be?
Asked
Active
Viewed 68 times
0

gen
- 9,528
- 14
- 35
- 64
-
3Terrible advice. I'd be interested to hear the teacher's explanation! – John La Rooy Jul 29 '13 at 06:12
-
for loops are just as useful but sometimes you need to use a while thats bad advice – Serial Jul 29 '13 at 06:15
1 Answers
2
Use the control statement that best suits your needs in each situation.
An advice like "Don't use while, only use for" boils down to "If the only tool you know is a hammer, all problems look like a nail."

Hyperboreus
- 31,997
- 9
- 47
- 87