Emulating do while loop in Python

In Python, there is no direct do-while
loop like in some other languages. However, you can emulate a do-while
loop by using a while
loop in combination with a break
condition.
print("Hi, Welcome to Programming ")
i=4
while i<6:
print(i)
if i==4:
break
i=i+1
Subscribe to my newsletter
Read articles from Aakanchha Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Aakanchha Sharma
Aakanchha Sharma
๐ Welcome to my Hashnode blog! I'm a tech enthusiast and cloud advocate with expertise in IT, backup solutions, and cloud technologies. Currently, Iโm diving deep into Python and exploring its applications in automation and data management. I share insights, tutorials, and tips on all things tech, aiming to help fellow developers and enthusiasts. Join me on this journey of learning and innovation!