Hong-Phuc Bui
2024-05-15 9879363a9e020c6a3c390852a986adb8d9cf7284
python-grundlage/dice-simulation.py
@@ -1,8 +1,9 @@
#! /usr/bin/evn python
import random
from typing import Final
random.seed(5643)
experiments = 500
experiments: Final[int] = 500
dice_roll = tuple(random.randint(1, 6) for r in range(0, experiments))
absolute_frequency = tuple((face, len([f for f in dice_roll if f == face]))
                           for face in range(1, 6 + 1)
@@ -16,4 +17,4 @@
relative_frequency = tuple(
    (absolute_frequency[idx][0], absolute_frequency[idx][1] / experiments) for idx in range(1, 6 + 1)
)
)