• + 0 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)))