fix a double random numbers a 6 aus 49 and Euro Jackpot
This commit is contained in:
parent
c35c16c6c5
commit
b18dac8a11
14
main.py
14
main.py
@ -10,8 +10,14 @@ def lotto():
|
|||||||
for i in range(1, 7):
|
for i in range(1, 7):
|
||||||
numbers.append(random.randint(1, 49))
|
numbers.append(random.randint(1, 49))
|
||||||
numstr = [str(x) for x in numbers] # Hier wird mit list comprehension die Integer in String umgewandelt.
|
numstr = [str(x) for x in numbers] # Hier wird mit list comprehension die Integer in String umgewandelt.
|
||||||
|
numdic = dict.fromkeys(numstr) # Dictionary von der Liste erstellen damit werden doppelte einträge entfernt.
|
||||||
|
numstr = list(numdic) # Dictionary wieder in Liste umwandeln
|
||||||
|
|
||||||
supernum.append(random.randint(0, 9))
|
supernum.append(random.randint(0, 9))
|
||||||
print(numstr, " Superzahl: ", supernum)
|
if len(numstr) != 6:
|
||||||
|
lotto()
|
||||||
|
else:
|
||||||
|
print(numstr, " Superzahl: ", supernum)
|
||||||
|
|
||||||
|
|
||||||
def euro_jack():
|
def euro_jack():
|
||||||
@ -20,9 +26,13 @@ def euro_jack():
|
|||||||
for i in range(1, 6):
|
for i in range(1, 6):
|
||||||
numbers.append(random.randint(1, 50))
|
numbers.append(random.randint(1, 50))
|
||||||
numstr = [str(x) for x in numbers] # Hier wird mit list comprehension die Integer in String umgewandelt.
|
numstr = [str(x) for x in numbers] # Hier wird mit list comprehension die Integer in String umgewandelt.
|
||||||
|
numdic = dict.fromkeys(numstr) # Dictionary von der Liste erstellen damit werden doppelte einträge entfernt.
|
||||||
|
numstr = list(numdic) # Dictionary wieder in Liste umwandeln
|
||||||
supernum.append(random.randint(1, 12))
|
supernum.append(random.randint(1, 12))
|
||||||
supernum.append(random.randint(1, 12))
|
supernum.append(random.randint(1, 12))
|
||||||
if supernum[0] != supernum[1]:
|
if len(numstr) != 5:
|
||||||
|
euro_jack()
|
||||||
|
elif supernum[0] != supernum[1]:
|
||||||
print(numstr, " Eurozahlen: ", supernum)
|
print(numstr, " Eurozahlen: ", supernum)
|
||||||
else:
|
else:
|
||||||
euro_jack()
|
euro_jack()
|
||||||
|
Loading…
Reference in New Issue
Block a user