From 9879363a9e020c6a3c390852a986adb8d9cf7284 Mon Sep 17 00:00:00 2001 From: Hong-Phuc Bui <hong-phuc.bui@htwsaar.de> Date: Wed, 15 May 2024 11:42:20 +0200 Subject: [PATCH] Template 4 Students OK --- python-grundlage/dice-simulation.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python-grundlage/dice-simulation.py b/python-grundlage/dice-simulation.py index 78fc39a..772a26d 100644 --- a/python-grundlage/dice-simulation.py +++ b/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) -) \ No newline at end of file +) -- Gitblit v1.10.0-SNAPSHOT