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

+18

Does python have do-while loop?

4/14/2021 8:22:54 PM

Anurag Madhesia

8 Answers

New Answer

+16

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

+11

Thank you

+2

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.

+1

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

+1

pannddorra Really Can you tell me

+1

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

0

As the title says. Maybe there is a diffrence between languages, in that case I'm learning C at the moment. https://www.mymilestonecard.run/

-2