You are viewing a single comment's thread. Return to all comments →
from fractions import Fraction max_num = 9 count = 0 total_combinations = 6**2 dice = range(1, 7) for die_1 in dice: for die_2 in dice: dice_sum = die_1 + die_2 if dice_sum <= max_num: count += 1 print(str(Fraction(count, total_combinations)))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Basic Probability Puzzles #1
You are viewing a single comment's thread. Return to all comments →