PEP 315: Enhanced While Loop

Steven Taschuk staschuk at telusplanet.net
Sat May 3 13:16:13 EDT 2003


Quoth Dan Bishop:
  [...]
>    while 1:
>       # ...
>       if not getYN("You are now dead.  Would you like to play again
> (Y/N)?"):
>          break
>       if getYN("Would you like to read the intro again (Y/N)?"):
>          intro()
> 
> I'm not sure what the equivalent do...while loop would be.

This, I presume:

    do:
        ...
        yn = getYN("You are now dead...")
    while not yn:
        if getYN("Would you like..."):
            intro()
        ...

-- 
Steven Taschuk                                7\ 7'Z {&~         .
staschuk at telusplanet.net                        Y r          --/hG-
                                            (__/ )_             1^1`





More information about the Python-list mailing list