while loop - multiple condition

Chris Angelico rosuav at gmail.com
Mon Oct 13 09:48:25 EDT 2014


On Mon, Oct 13, 2014 at 11:09 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> Or, even simpler: Use an active condition.
>>
>> while input('Do you like python?') not in ('yes', 'y'): pass
>
> Instead of the traditional "pull" technology, you could take advantage
> of the state-of-the-art "push" approach:
>
>    print("You must love python -- everybody does!")

Nay, there is love in excess. I thank heaven there are many pythons in
England; but if thou lovest them all, I withdraw my thanks!
-- Colonel Fairfax

ChrisA



More information about the Python-list mailing list