import random randork = [] while len(randork) < 6: r = random.randint(1, 40) if r not in randork: randork.append(r) print ("Lottery numbers:", randork)