import random def randomsix() : number = random.randint(1, 45) return number lotto_num = [] count = 0 while True : if count > 5 : break random_number = randomsix() if random_number not in lotto_num: lotto_num.append(random_number) count = count + 1 lotto_num.sort() print(lotto_num)