Dec-06-2019, 09:51 PM
You need to assign the result of random.choice, and then test that. Something like:
elif player_choice == '3': attempt = random.choice(dodge1) if attempt == 1: print('You dodged the monsters attack!') ...There's a little trick for random true/false: random.randrange(2) returns 0 or 1 randomly. 0 evaluates to False in a conditional, and 1 evaluates as true. So you can do this:
elif player_choice == '3': dodged = random.randrange(2) if dodged: print("You dodged the monster's attack!") ...
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures