sairate 7df250638d chore: 添加项目基础结构和示例代码
- 创建 .idea 目录和相关配置文件,设置项目结构
- 添加多个课堂成果示例代码,涵盖不同主题和功能
- 创建和配置 .gitignore 文件,忽略特定文件和目录
2025-07-05 09:36:00 +08:00

19 lines
671 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import random
def choujiang():
lucky_num = random.randint(1,20) # 随机生成幸运数字1~20
num = int(input('请从1到20之间选择一个数字进行抽奖'))
if num == lucky_num: # 判断是否中奖
print('天选幸运儿恭喜你抽中大奖——狂欢夜当晚0元购')
else:
print("幸运数字" + str(lucky_num))
print('再接再厉!后面的题目还在等着你')
right = int(input('共20题你答对了多少道题'))
if right > 5:
print('呱唧呱唧!获得抽奖机会!')
choujiang() # 开始抽奖
else:
print('很遗憾,没有获得抽奖机会,再接再厉!')