Hey everyone i am a newbie to python so could someone help me figure out why this code keeps returning "how are you" no matter what i input for x. Im trying to minimalize the amount of elif statements in the program by combining them with the OR inbetween.
print 'hello'
x = raw_input ('')
if x=='hi' or 'hey' or 'hello' or 'whats up' or 'wats up' or 'watsup' or 'sup':
print 'how are you'
elif x=='who are you' or 'what are you' or 'whats your name' or 'wats your name':
print 'my name is compy'
else:
print 'i dont understand your gibberish'
THANX EVERYONE
ps the lines after the if elif and else statements are all indented in my actual code i just couldnt get them to indent on this posting.
print 'hello'
x = raw_input ('')
if x=='hi' or 'hey' or 'hello' or 'whats up' or 'wats up' or 'watsup' or 'sup':
print 'how are you'
elif x=='who are you' or 'what are you' or 'whats your name' or 'wats your name':
print 'my name is compy'
else:
print 'i dont understand your gibberish'
THANX EVERYONE
ps the lines after the if elif and else statements are all indented in my actual code i just couldnt get them to indent on this posting.
Comment