This commit is contained in:
mantaru 2024-09-10 22:04:16 +02:00
commit dfe03b989a
7 changed files with 87 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -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

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

8
.idea/lotto.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.10" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/lotto.iml" filepath="$PROJECT_DIR$/.idea/lotto.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

44
main.py Normal file
View File

@ -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)