I currently have the code:
fleechance = random.randrange(1,5)
print fleechance
if fleechance == 1 or 2:
print \"You failed to run away!\"
elif fleechance
The expression fleechance == 1 or 2
is equivalent to (fleechance == 1) or (2)
. The number 2
is always considered “true”.
Try this:
if fleechance in (1, 2):
EDIT: In your situation (only 2 possibilities), the following will be even better:
if fleechance <= 2:
print "You failed to run away!"
else:
print "You got away safely!"