Does python have do-while loop? | Sololearn: Learn to code for FREE!


Does python have do-while loop?

4/14/2021 8:22:54 PM

Anurag Madhesia

8 Answers

New Answer


Python has no do-while-loop. You could emulate it in the following way: while True: stuff() if fail_condition: break


Thank you


A do-while loop is important because it is a post-test loop, meaning that it checks the condition only after executing the code in the loop block. Even though Python doesn't explicitly have the do-while loop , we can emulate it.


Anurag Madhesia Python doesn't have do-while loop.


pannddorra Really Can you tell me


no do-while-loop, but it exist that. while (condition) : instruction 1 instruction 2 ...


As the title says. Maybe there is a diffrence between languages, in that case I'm learning C at the moment.