no do...while ?

Cliff Crawford cjc26 at nospam.cornell.edu
Sat Aug 4 09:33:12 EDT 2001


* Thomas Weidner <wolf359_ at gmx.net> menulis:
| Hi NG,
| 
| I think everybody knows what a do{...}while(...); loop in c is,but is there
| something like that in python ?

do {
    do_stuff();
} while(test());

can be written like this in Python:

while 1:
    do_stuff()
    if not test(): break


-- 
Cliff Crawford                           http://www.sowrong.org/
"Today's Goths, who generally tend to be in their teens and 20s,
have nothing to do with the Germanic Visigoths of Europe in the
third and fourth centuries A.D."               -- Jimmy Stewart



More information about the Python-list mailing list