do ... while loop

Dan Schmidt dfan at harmonixmusic.com
Fri Oct 15 09:37:34 EDT 1999


Gerrit Holl <gerrit.holl at pobox.com> writes:

| Tim Peters:
|
| >     while 1:
| >         xxx
| >         yyy
| >         if not condition:
| >             break
| 
| Huh?
| Why don't use the following code:
| 
| while condition:
|     xxx
|     yyy
| 
| I don't understand the difference.

If the condition is false the first time, Tim's loop will execute once
and your loop will not execute any times.

-- 
Dan Schmidt | http://www2.thecia.net/users/dfan/




More information about the Python-list mailing list