Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import random

def correct_num(dice):
    return sorted(dice) == [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

def sample():
    return [random.randint(1,5) for _ in range(10)]


total = 0
correct = 0
for i in range(100000):
    if correct_num(sample()):
        correct += 1
    total += 1

print(correct, total)
print(correct/total)
Python 3.6.1 (default, Dec 2015, 13:05:11) [GCC 4.8.2] on linux