jeudi 5 février 2015

Basic If-statement not working properly - Python [duplicate]


This question already has an answer here:




This code is for a basic adventure game I am writing. I keep getting dead('you become a workaholic etc...') even when I input 'refuse' or 'sdef' in Python.


Help!!



from sys import exit

def dead(why):
print why
exit(0)

def nyc():
print '''You arrive in NYC and have a bank job lined up. will you take it or leave it?'''

choice = raw_input('> ')

if 'take' or 'accept' in choice:
dead('You become a workaholic and die of heart failure.')

elif 'refuse' or 'decline' or 'leave' or 'not' in choice:
bum()

else:
dead('Its banking or no deal buddy...you dead')

Aucun commentaire:

Enregistrer un commentaire