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