1
I’m doing a program that renders keys to the euro millions, but the keys are None
, what is my mistake?
import random
print('Chave do Euromilhões')
num= [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]
estr=[1,2,3,4,5,6,7,8,9,10,11]
while True:
n1= random.randint(1,50)
if n1 in num:
#print(n1, end=', ')
break
while True:
n2= random.randint(1,50)
if n2 in num and n1!=n2:
#print(n2, end=', ')
break
while True:
n3= random.randint(1,50)
if n3 in num and n1!=n3 and n2!=n3:
#print(n3, end=', ')
break
while True:
n4= random.randint(1,50)
if n4 in num and n1!=n4 and n2!=n4 and n3!=n4:
#print(n4, end=', ')
break
while True:
n5= random.randint(1,50)
if n5 in num and n1!=n4 and n2!=n5 and n3!=n5 and n4!=n5:
#print(n5, end='. ')
break
Números= [n1,n2,n3,n4,n5]
Números=Números.sort(reverse= False)
print(Números)
while True:
e1= random.randint(1,11)
if e1 in num:
#print(e1, end=', ')
break
while True:
e2= random.randint(1,11)
if e2 in num and e1!=e2:
#print(e2, end='. ')
break
Estrelas= [e1,e2]
Estrelas=Estrelas.sort(reverse= False)
print('Os números do euromilhões são:',Números)
print('As estrelas são:', Estrelas)
I had done it initially, but it wasn’t working for me, but thanks anyway, it worked!
– Juliana Mendes Alves