Equivalent of Do-While?

C

Code_Dark

Hi, I'm coming over to python from C and C++, and I was just wondering
if there's an equivalent of the Do-While fuction that I'm so fond
of... I really like it, and it's handy for asking the user if they'd
like to repeat a program (or parts of a program). Please reply to this
or email me at (e-mail address removed). Just take up the NOSPAM-
part ;-)

Thanks in advance,

- Code_Dark
 
E

Erik Max Francis

Code_Dark said:
Hi, I'm coming over to python from C and C++, and I was just wondering
if there's an equivalent of the Do-While fuction that I'm so fond
of... I really like it, and it's handy for asking the user if they'd
like to repeat a program (or parts of a program).

Use something like

while True:
... do something ...
if not condition:
break
... do something more ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top