samedi 23 décembre 2017

python if elif diffucltys

I am using a very simple and basic if elif in python but it only will give me the same result no mater what my input is.

answer = input('Do you like christmas? ')

if answer == 'no' or 'No':
    print('Your so uncool, just leave, this is a place for festive people you 
    heartless monster')


elif answer == 'yes' or 'Yes':
    print('Your pretty cool, you can stay, just dont get drunk on the eggnog and 
    make out with the dog...')


elif 'brit' or 'Brit' in answer:
    print('I was gunna be mean to brit, but its christmas and I am not allowed 
    because a fat man in a red suit will reck me')


else:
    print('MAKE UP YOUR MIND, YOU SUCK')

the outputs are place holders but at the moment all I get when I run this is the the print for the no answer, weather I answer no yes or anything else...

edit: I see now that in the question my indenting looks really terrible, that isn't how I wrote it but that is just from posting it here, please assume that indentation is correct.

Aucun commentaire:

Enregistrer un commentaire