Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------
- #
- #from random import randint
- #Lottonumbers = [0,0,0,0,0,0]
- #index 0 1 2 3 4 5
- #
- #6 Random Numbers
- #def newLottoNumbers():
- # for izahl in range(0,len(Lottonumbers)-1):
- # prelotto = randint(1,49)
- #
- # #Auf doppelte überprüfen
- # if (prelotto in Lottonumbers):
- # print("Doppelte zahl")
- # while(True):
- # newzahl = randint(1,49)
- # if (prelotto != newzahl):
- # Lottonumbers[izahl] = newzahl
- # break
- # else:
- # print("Schon wieder selbe Zahl")
- # return
- # else:
- # Lottonumbers[izahl] = prelotto
- #
- #Getter and Setter
- #def getLotto(accessInt):
- # return Lottonumbers[accessInt]
- #
- #def setLottoNumber(accessInt, number):
- # Lottonumbers[accessInt]=number
- #
- #def printLotto():
- # print(Lottonumbers)
- #
- #
- #---------------------------------------------------------
- from random import randint
- stats = [0]
- playing = True
- while(playing):
- #Reset
- Lottonumbers = [0,0,0,0,0,0]
- tipp = [0,0,0,0,0,0]
- matching = 0
- #Tipp
- print("\n-------------------------------------\nTippe 6 Zahlen zwischen 1 und 49")
- for i in range(0, len(Lottonumbers)):
- index = i+1
- tipp[i] = int(input(str(index)+". Tipp "))
- #NewLottoNumbers
- for i in range(0, len(Lottonumbers)-1):
- prelotto = randint(1,49)
- if (prelotto in Lottonumbers):
- while(True):
- newzahl = randint(1,49)
- if (prelotto != newzahl):
- Lottonumbers[i] = newzahl
- break
- else:
- Lottonumbers[i] = prelotto
- print("\n\nDein Tipp")
- print(tipp)
- print("Ziehung")
- print(Lottonumbers)
- print("\n")
- for i in range(6):
- if(tipp[i] in Lottonumbers):
- matching +=1
- print("Es stimmen ", matching, "überein\n\n")
- #StatsManager
- stats.append(matching)
- print("Deine Statistiken")
- #Stats ausschreiben
- for i in range(1, len(stats)):
- if(stats[i]==0):
- print("Beim ",i,"ten Spiel waren ", stats[i], "richtig ( 00.00 %)")
- else:
- print("Beim ",i,"ten Spiel waren ", stats[i], "richtig (",round((100/6)*stats[i],2),"%)")
- #Switch for next round
- print("\n\n")
- print("nochmal spielen?")
- again = input("(Y/N) ")
- if (again == "N"):
- playing = False
- else:
- playing = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement