From dfe03b989a4e311124bed5199c1fbf426f84fe1f Mon Sep 17 00:00:00 2001 From: mantaru Date: Tue, 10 Sep 2024 22:04:16 +0200 Subject: [PATCH] start --- .idea/.gitignore | 8 ++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/lotto.iml | 8 ++++ .idea/misc.xml | 7 +++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ main.py | 44 +++++++++++++++++++ 7 files changed, 87 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/lotto.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 main.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/lotto.iml b/.idea/lotto.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/lotto.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..9de2865 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6bcdc66 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..b55962c --- /dev/null +++ b/main.py @@ -0,0 +1,44 @@ +import random +import time + +def f_input(liste): + liste = liste.split(',') + output = [] + for element in liste: + output.append(int(element)) + return output + +def zieh(): + liste = [] + while len(liste) != 6: + z_zahl = random.randint(1,49) + if z_zahl not in liste: liste.append(z_zahl) + return liste + +tipp = input("Tipp für 6-aus-49 mit Komma getrennt eingeben: ") +tipp = f_input(tipp) + +anz_sim = int(input("Geben Sie die Anzahl der gewünschten Simulationen ein: ")) + +richtige = [0, 0, 0, 0, 0, 0, 0] + +start_time = time.time() + +for i in range(int(anz_sim)): + ziehung = zieh() + richtigeC = 0 + for j in ziehung: + if j in tipp: richtigeC += 1 + richtige[richtigeC] += 1 + +end_time = time.time() +laufzeit = end_time - start_time + +richtige_relativ = [0, 0, 0, 0, 0, 0, 0] + +for i in range(0,len(richtige)-1): + richtige_relativ[i] = richtige[i] / anz_sim + +print(richtige) +print(richtige_relativ) +print(laufzeit) \ No newline at end of file