while loop - multiple condition

Marko Rauhamaa marko at pacujo.net
Mon Oct 13 08:09:19 EDT 2014


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!")


Marko



More information about the Python-list mailing list