Guest User

Untitled

a guest
Oct 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #Author: Chetan Takyar
  2. #Date: 23rd October
  3.  
  4. import random
  5.  
  6. print("This program simulates a turn of Cho-Han")
  7.  
  8. guess = str(input("Please enter a guess - Even or Odd:"))
  9.  
  10. dice = random.randint(1,6)
  11. dice_two = random.randint(1,6)
  12.  
  13. dice_total = dice + dice_two
  14. print("The total thrown is ", dice_total)
  15.  
  16. if (guess == "Even" and dice_total % 2 == 0):
  17. print("Congratulations! You have won!")
  18.  
  19. elif(guess == "Odd" and dice_total % 2 == 0):
  20. print("Sorry! You have lost!")
  21.  
  22. elif (guess == "Odd" and dice_total % 2 == 0):
  23. print("Sorry! you have lost!")
  24.  
  25.  
  26. elif (guess == "Odd" and dice_total % 2 == 1):
  27. print("Congratulations! You have won!")
Add Comment
Please, Sign In to add comment