Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Equivalent of Do-While?

Reply
Thread Tools

Equivalent of Do-While?

 
 
Code_Dark
Guest
Posts: n/a
 
      11-06-2003
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 . Just take up the NOSPAM-
part

Thanks in advance,

- Code_Dark
 
Reply With Quote
 
 
 
 
Erik Max Francis
Guest
Posts: n/a
 
      11-06-2003
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 && && 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning:Xst:382 - Register A is equivalent to B mag VHDL 1 05-19-2005 05:10 PM
instancename of current entity/architecture -- equivalent to C++ this??? Eric Peers VHDL 2 11-18-2004 05:23 PM
VHDL equivalent of verilog trireg Sanjeev VHDL 4 07-23-2004 09:55 AM
equivalent types in different packages Lolo VHDL 3 09-22-2003 03:23 PM
Re: Image Scanning - TWAIN equivalent Brendan Duffy ASP .Net 0 07-24-2003 08:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57