Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------
- #
- from random import randint
- Lottozahlen = [0,0,0,0,0,0]
- #index 0 1 2 3 4 5
- #6 Random Numbers
- def newLottoNumbers():
- for izahl in range(0,len(Lottozahlen)-1):
- prelotto = randint(1,49)
- #Auf doppelte überprüfen
- if (prelotto in Lottozahlen):
- print("Doppelte zahl")
- while(True):
- newzahl = randint(1,49)
- if (prelotto != newzahl):
- Lottozahlen[izahl] = newzahl
- break
- else:
- print("Schon wieder selbe Zahl")
- return
- else:
- Lottozahlen[izahl] = prelotto
- #Getter and Setter
- def getLotto(accessInt):
- return Lottozahlen[accessInt]
- def setLottoNumber(accessInt, number):
- Lottozahlen[accessInt]=number
- def printLotto():
- print(Lottozahlen)
- #
- #---------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement