a gap of do....while?

StarWing weasley_wx at sina.com
Sun Oct 18 01:41:56 EDT 2009


On 10月18日, 下午1时36分, Chris Rebert <c... at rebertia.com> wrote:
> On Sat, Oct 17, 2009 at 10:34 PM, Chris Rebert <c... at rebertia.com> wrote:
> > On Sat, Oct 17, 2009 at 10:22 PM, StarWing <weasley... at sina.com> wrote:
> <snip>
> >> but in python, we only can:
> >> cond = 1
> >> while cond:
> >>    cond = 0
> >>    .....
> >>    if ....: cond = 1
>
> >> has any polite way to handle this?
>
> > It's essentially the same:
>
> > while True:
> >    ...
> >    if not cond: break
>
> Substituting in the appropriate conditional expression for cond of
> course (your use of cond for the flag caught me off guard).
>
> Cheers,
> Chris

Thank you, this is nice than mine :-)



More information about the Python-list mailing list