do while loop

Dave Hansen iddw at hotmail.com
Wed Apr 26 17:42:51 EDT 2006


On Wed, 26 Apr 2006 22:41:04 +0200 in comp.lang.python, Marc
'BlackJack' Rintsch <bj_666 at gmx.net> wrote:

>In <1146012542.166096.78690 at g10g2000cwb.googlegroups.com>, ? wrote:
>
>> suggest  add do while loop in later version
>
>Please also suggest a clean syntax for this.  :-)
>

while 1:
   do_loop_stuff()
   if time_to_leave(): break

Well, maybe not too clean, but it works today...

For the future, maybe:

   do:  #or "repeat:"
      do_loop_stuff()
   until time_to_leave()

Regards,
                                        -=Dave

-- 
Change is inevitable, progress is not.



More information about the Python-list mailing list