Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- player_name = input("What is your name? ")
- player = input("Do you pick odd or even? ")
- if player == "odd" or player == "Odd":
- print("Ok, you have chosen odds!")
- if player == "even" or player == "Even":
- print("Ok, you have chosen evens!")
- throw = int(input("How many fingers do you throw (1-5)?: "))
- comp = random.randint(1, 5)
- print("The computer threw", comp,".")
- total = comp + throw
- print("The total is", total)
- if player == "even" or player == "Even":
- if total % 2 == 0:
- print("Congrats,",player_name,"won!")
- else:
- print("Sorry,",player_name,"lost.")
- if player == "odd" or player == "Odd":
- if total % 2 == 0:
- print("Sorry,",player_name,"lost.")
- else:
- print("Congrats,",player_name,"won!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement