On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote:
if s = raw_input ("hello what's your name? ")
if s=='carmel ':
print "Ahh the boss's wife"
What i would like to know is what if she doesn't write carmel she rights say carm short of me writing if s=='carm': on a new line is there a shorter way of doing this so i can cover all angles on how she might write her name.
Thanks nigeps I appologise for my earlier thread
> if she doesn't write
carmel
she rights say carm
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"
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"
-- http://mail.python.org/mailman/listinfo/python-list