Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://stackoverflow.com/questions/70792478/how-can-i-get-my-program-to-display-match-when-three-numbers-are-the-sam
- import random
- # --- before loop ---
- rolls = 50
- total_matches = 0 # PEP8: `lower_case_names` for variables
- # --- loop ---
- for i in range(rolls):
- die1 = random.randint(1, 6)
- die2 = random.randint(1, 6)
- die3 = random.randint(1, 6)
- print(die1, "|", die2, "|", die3)
- if die1 == die2 == die3:
- print("****MATCH*****")
- total_matches += 1
- # --- after loop ---
- print()
- print("The total number of matches was:", total_matches)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement