Python doesn't have an equivalent of do-while loop as in C/C++ or Java. The essence of do-while loop is that the looping condition is verified at the end of looping body. This feature can be emulated by following Python code −
Example
condition=True x=0 while condition==True: x=x+1 print (x) if x>=5: condition=False
Output
The output is as follows −
1 2 3 4 5