+ 2

Why python has no do...while loop?

Java, JavaScript, C++ etc have do....while loop but python does not have such loop.

27th Aug 2019, 12:14 PM
Piush K Sangma
Piush K Sangma - avatar
5 Réponses
+ 2
Official stance/justification: "Users of the language are advised to use the while-True form with an inner if-break when a do-while loop would have been appropriate." You can use this instead: while True: # statements if fail_condition: break
28th Aug 2019, 1:58 AM
Tashila Pathum
Tashila Pathum - avatar
+ 1
I think do...while is useless. i mean just think about it, useless
29th Aug 2019, 9:27 AM
Eyob
Eyob - avatar
0
Thanks for your supports
17th Sep 2019, 6:04 AM
Piush K Sangma
Piush K Sangma - avatar