While loop with "or"? Please help!

Peter Otten __peter__ at web.de
Thu Jan 25 07:39:08 EST 2007


Bruno Desthuilliers wrote:

> and simplified again thanks to Python 'in' operator:
> while not usrinp.lower() in "yn":

But note that 'in' performs a substring search and therefore "yn" and ""
would be accepted as valid answers, too.

Peter 




More information about the Python-list mailing list