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)
ImSeanDowney
  • 23
  • 1
  • 6

1 Answers1

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:
    ...
Dair
  • 15,910
  • 9
  • 62
  • 107