Fix Python – Is there a “do … until” in Python? [duplicate]

Question

Asked By – Matt Joiner

Is there a

do until x:
    ...

in Python, or a nice way to implement such a looping construct?

Now we will see solution for issue: Is there a “do … until” in Python? [duplicate]


Answer

There is no do-while loop in Python.

This is a similar construct, taken from the link above.

 while True:
     do_something()
     if condition():
        break

This question is answered By – theycallmemorty

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0