raw_input

Peter Hansen peter at engcorp.com
Fri Mar 24 08:28:44 EST 2006


Tim Williams (gmail) wrote:
> The following will accept any subset of "carmel" in upper, lower or 
> mixed case  
> 
> EG   Carmel, carmel, Carm, mel etc
> 
>  >>> if raw_input ("hello what's your name? ").lower() in 'carmel':
> ....     print "Ahh the boss's wife" 

It's so powerful, it accepts even the empty string... try typing just 
the ENTER key...

-Peter




More information about the Python-list mailing list