Advertisement
geapsi

Mega-Sena

Jul 12th, 2014
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import random
  2.  
  3. dez1 = ['0','1','2','3','4','5','6']
  4. dez2 = ['0','1','2','3','4','5','6']
  5.  
  6. sorteio = []
  7. while len(sorteio) <= 5:
  8.     x = random.randint(0,6)
  9.     random.shuffle(dez1)
  10.     random.shuffle(dez2)
  11.     dezena = dez1[x]+dez2[x]
  12.     if dezena != '00' and dezena not in sorteio and int(dezena) <= 60:
  13.         sorteio.append(dezena)
  14.  
  15. print("Dezenas sorteadas")
  16. sorteio.sort()
  17. for item in sorteio:
  18.     print(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement