Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Equivalent of Do-While? (http://www.velocityreviews.com/forums/t324559-equivalent-of-do-while.html)

Code_Dark 11-06-2003 03:43 AM

Equivalent of Do-While?
 
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 dshaw858@NOSPAM-hotmail.com. Just take up the NOSPAM-
part ;-)

Thanks in advance,

- Code_Dark

Erik Max Francis 11-06-2003 03:49 AM

Re: Equivalent of Do-While?
 
Code_Dark wrote:

> 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 ...

--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ The color is red / Under my shoe
\__/ Neneh Cherry


All times are GMT. The time now is 05:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.