Advertisement
biswasrohit20

dice

May 15th, 2021
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import random
  2. dice1 = 0
  3. dice2 = 0
  4. priorRoll = -1
  5. while True:
  6. dice1 = random.randint(1,6)
  7. dice2 = random.randint(1,6)
  8. sum = dice1 + dice2
  9. print(f"Roll: total = {sum}")
  10. if sum in [7, 11, priorRoll]:
  11. print(f"Woah!!! With a {sum} You WIN!!!!!!!")
  12. break
  13. elif sum in [2, 3, 12]:
  14. print(f"Sorry with a {sum} You LOSE :(")
  15. break
  16. priorRoll = sum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement