def generate_lottery_numbers(total_numbers, number_range): lottery_numbers = random.sample(range(1, number_range + 1), total_numbers) return sorted(lottery_numbers) if _name_ = "_main_": total_numbers = 6 number_range = 49 lottery_numbers = generate_lottery_numbers(total_numbers, number_range) print("Your lottery numbers are:", lottery numbers)