import random lottery_numbers = list(random.randint (1, 40) for _ in range (6)) print(lottery_numbers)