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

29 lines
1.0 KiB
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.

#请在这里编写代码
name = ['黄昏','黎明','007','萧炎','唐三']
task = ['潜入敌国获取情报',
'采摘生长在天山的雪莲花',
'给隔壁出差李阿姨家的喵喵加粮',
'营救被扣押的人质',
'破解电脑系统获取目标数据']
skill = input("请使用特工技能(1.跳跃2.隐匿3.射击)")
if skill == '1':
print('成功进入李阿姨的院子')
skill = input('请使用特工技能(1.跳跃2.隐匿3.射击)')
if skill == '2':
print('成功加粮')
# 方法一:删除指定元素,指定索引位置添加元素
task.pop(2)
task.insert(2,'抢回被夺走的特工名单')
# 方法二:修改列表元素
# task[2] = '抢回被夺走的特工名单'
print(task)
elif skill == '2':
print('无法进入院子')
elif skill == '3':
print('任务失败,被组织除名')
name.pop(2) # 或者name.remove('007')或者del name[2]
print(name)
else:
print('请正确输入技能编号')