I have a code snippet bellow and because of habit from other programming languages I wanted to use rather do-while loop. But Python offers only the construct which I show as a second code snippet instead of do-while loop. What is the best pythonic way to code this?
ch = getch()
while ch != "q":
do_something()
ch = getch()
while True:
ch = getch()
do_something()
if ch == "q":
break