0

I have it set so if 'yea' is in the input it outputs a certain responsonce but I want it to understand yea,yes and yeah. Here is the code!

name = raw_input ("What's your name?")

if 'Sean' in name:    
name1 = raw_input("Downey or Paul?")        
if 'Downey' in name1:    
    print ("Hi Sean Downey")
    x = raw_input("Did you know that the name is irish?")
    if x == 'yea':
        print ('oh cool')
elif 'Paul' in name1:    
    print ("Hi Sean Paul")    
else:    
    print ("I don't know that Sean")
else:    
print ('Hi %s') % (name)
0

1 Answer 1

1

You can put the confirmations in a tuple and check if x is in the tuple:

confirmations = ('yeah', 'yes', 'yea')
if x in confirmations:
    ...
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.