Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Author: Chetan Takyar
- #Date: 23rd October
- import random
- print("This program simulates a turn of Cho-Han")
- guess = str(input("Please enter a guess - Even or Odd:"))
- dice = random.randint(1,6)
- dice_two = random.randint(1,6)
- dice_total = dice + dice_two
- print("The total thrown is ", dice_total)
- if (guess == "Even" and dice_total % 2 == 0):
- print("Congratulations! You have won!")
- elif(guess == "Odd" and dice_total % 2 == 0):
- print("Sorry! You have lost!")
- elif (guess == "Odd" and dice_total % 2 == 0):
- print("Sorry! you have lost!")
- elif (guess == "Odd" and dice_total % 2 == 1):
- print("Congratulations! You have won!")
Add Comment
Please, Sign In to add comment