fork download
  1. from random import randint
  2.  
  3. lista = set()
  4. n = 6
  5.  
  6. while len(lista) < n:
  7. lista.add(randint(1, 60))
  8.  
  9. lista = sorted(lista) # transformar em lista e ordenar
  10. print(lista)
Success #stdin #stdout 0.01s 12368KB
stdin
Standard input is empty
stdout
[26, 29, 32, 34, 47, 58]