Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- OddorEven = random.randint(1,2)
- if OddorEven == 1:
- print("You are odds")
- if Oddoreven == 2:
- print("You are evens")
- playerNum = int(input("How many fingers do you want to throw (1-5): "))
- if playerNum <= 5 and playerNum >= 1:
- computerNum = random.randint(1, 5)
- print("Computer throws", computerNum)
- total = playerNum + computerNum
- print("total figers are", total)
- if Oddsoreven == 1:
- if total % 2 == 0:
- print("You lost.")
- else:
- print("You won!")
- if OddsorEven == 2:
- if total % 2 == 0:
- print("You won!")
- else:
- print("You lost.")
- else:
- while playerNum >= 6 or playerNum <= 0:
- print("You can't do that")
- playerNum = int(input("How many fingers do you want to throw (1-5): "))
- if playerNum <= 5 and playerNum >= 1:
- computerNum = random.randint(1, 5)
- print("Computer throws", computerNum)
- total = playerNum + computerNum
- print("total figers are", total)
- if Oddsoreven == 1:
- if total % 2 == 0:
- print("You lost.")
- else:
- print("You won!")
- if OddsorEven == 2:
- if total % 2 == 0:
- print("You won!")
- else:
- print("You lost.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement