import randomlucky_num = []
lucky_count = 0 for time in range(0, 3): lucky_count = 0 print(f'第一次抽奖现在开始,这次抽的是{3-time}等奖\n')if time == 0: reward = "三斤苹果"elif time == 1: reward = "iPhone14手机"else:reward = "泰国5日游 + 手术费报销"if time == 0: while True:lucky = random.randint(1, 301) if lucky not in lucky_num:lucky_num.append(lucky) lucky_count = lucky_count + 1 print(f"{lucky_count}. 恭喜{lucky}号抽中{3-time}等奖,获得{reward}奖励")if lucky_count == 30:print("----------------------------------------------------------")breakelif time == 1: while True:lucky = random.randint(1, 301) if lucky not in lucky_num:lucky_num.append(lucky) lucky_count = lucky_count + 1 print(f"{lucky_count}. 恭喜{lucky}号抽中{3 - time}等奖,获得{reward}奖励")if lucky_count == 6:print("----------------------------------------------------------")breakelif time == 2: while True:lucky = random.randint(1, 301) if lucky not in lucky_num:lucky_num.append(lucky) lucky_count = lucky_count + 1 print(f"{lucky_count}. 恭喜{lucky}号抽中{3 - time}等奖,获得{reward}奖励")if lucky_count == 3:print("----------------------------------------------------------")break