import random a=[] for number in range(6): x=random.randint(1, 40) while x in a: x=random.randint(1, 40) a.append(x) print("Lottery Numbers: ") for index in a: print(index, end=" ")