# Homeworks
## Homework Tasks:
1. Can I use my pocket money to clear my shopping cart during Double Eleven? Knowing the items you want to buy and the unit price, as well as the available shopping funds in hand, determine whether you can clear the shopping cart.
Tip: Use a dictionary to create a shopping list, wants = {"computer":9999, "headphones":3500, "keyboard":2000}.
Input and output examples:
2. Guess the number game
Your program needs to generate a random number between 1 and 100, and then ask the user: "Please guess a number between 1 and 100." The user has unlimited opportunities to guess this number until they guess correctly. Each time the user guesses, the program needs to tell the user whether the number they guessed is too high or too low until the user guesses correctly. When the user guesses the number correctly, the program should output how many times it took to guess the number correctly.
Require:
(1) Use the random module to generate random numbers between 1 and 100.
(2) Use the while to let the user guess numbers repeatedly.
(3) Use an if statement to determine the relationship between the number guessed by the user and the random number.
(4) After the user guesses the number correctly, output how many times it took to guess the number correctly.
3. text adventure game
Your program needs to create a text adventure game in which the player goes on an adventure in a virtual world. Players can choose to move "forward", "left", or "right" to explore different locations. Each location has different events or items, and players need to make choices based on the events. For example, in one location, players may encounter monsters and can choose to "fight" or "escape"; in another location, players may find treasures and can choose to "pick up" or "leave."
Require:
(1) Create a virtual world of different places, events, and options.
(2) Players start the game at a specific location in the virtual world.
(3) Use a while loop to keep the game going until the player chooses to quit.
(4) Use if statements to display different events or outcomes based on player choices.
(5) In each location, different options are provided to the player, and the player can choose one of them to decide the next action.
(6) The game should have a victory condition, such as finding the treasure or defeating the final boss.
4. Enter an integer less than 1000 and factor it
Output: For example 99 = 3\*3\*11
Analysis: To decompose the correct input n into prime factors, you should first find a minimum prime number k, and then complete the following steps:
(1) If this prime number is exactly equal to n, it means that the process of decomposing prime factors has ended, just print it out.
(2) If n!=k, but n is divisible by k, the value of k should be printed out, and the quotient of n divided by k is used as the new positive integer n, and the first step is repeated.
(3) If n is not divisible by k, use k+1 as the value of k and repeat the first step.
## Submission Content:
1. Submit .txt or .py files containing the source code (one file for each task).
2. Submit screenshots of the program running (one screenshot for each task) or a video demo for each task.
## Grading Criteria:
1. Functionality Completeness (50%): Whether all tasks are completed as per the requirements.
2. Code Quality (30%): Readability, modularity, appropriate use of comments, independent completion, etc.
3. Screenshots of Execution (10%): Clear and valid screenshots demonstrating the proper functioning of the program.
4. Other Criteria (10%): Timely submission, adherence to guidelines, etc.
Note: Please ensure that the submitted code and screenshots are clear and visible. Grading will be based on the completeness and quality of the assignment.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【无积分此资源可私信博主有偿获取】 适合学习/练手、毕业设计、课程设计、期末/期中/大作业、工程实训、相关项目/竞赛学习等。 项目具有较高的学习借鉴价值,也可直接拿来修改复现。可以在这些基础上学习借鉴进行修改和扩展,实现其它功能。 可放心下载学习借鉴,你会有所收获。 —— 【无积分此资源可私信博主有偿获取】 对于学习和实践,选择合适的项目和资源确实是一种有效的方式。 在进行毕业设计、课程设计或大作业时,选择具备学习借鉴价值的项目可以帮助你理解和应用所学知识,同时也可以通过修改和扩展来实现其他功能。 通过参与实际项目,你可以应用所学的理论知识,深入了解软件开发或其他领域的实践流程和技术要求。 可放心下载学习借鉴,你会有所收获。 # 注意 1. 本资源仅用于开源学习和技术交流。不可商用等,一切后果由使用者承担。 2. 部分字体以及插图等来自网络,若是侵权请联系删除。
资源推荐
资源详情
资源评论
收起资源包目录
2023 Python语言程序设计课后作业合集.zip (147个子文件)
main.c 80B
Iris.csv 5KB
Iris.csv 5KB
Homework2.docx 141KB
README.docx 52KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
chinamap.jpg 22KB
README.md 4KB
READMEzh-cn.md 3KB
README.md 2KB
README.md 2KB
readme.md 2KB
README.md 2KB
README.md 993B
README.md 825B
README.md 199B
README.md 195B
README.md 39B
README.md 30B
README.md 30B
README.md 21B
README.md 0B
3.png 1.97MB
2.2.png 1.89MB
2.3.png 1.86MB
1.png 1.83MB
2.1.png 1.75MB
1.png 1.46MB
2.png 1.43MB
3-2.png 1.43MB
3-ctrl C.png 1.42MB
4.png 1.42MB
3.png 1.38MB
3-1.png 1.37MB
3.png 772KB
5.png 768KB
7.png 757KB
2.png 735KB
6.png 723KB
1.png 691KB
2.png 665KB
1.png 620KB
1.png 593KB
4.png 535KB
3.png 533KB
4.png 520KB
1.png 514KB
2.png 498KB
3.png 492KB
2.png 484KB
pytestcloud2.png 311KB
mind.png 139KB
testcloudm.png 128KB
A screenshot of the runtime.png 118KB
sanguo.png 54KB
pytestcloud1.png 14KB
part1.png 7KB
3.py 6KB
1.py 5KB
3.py 3KB
1.py 2KB
2.py 2KB
1.py 2KB
1.py 1KB
main.py 1KB
main.py 1KB
2.py 968B
3.py 899B
3.py 806B
1.py 750B
2.py 663B
3.py 638B
ciyun4.py 586B
ciyun3.py 556B
1.py 550B
ciyun2.py 483B
6.py 478B
demo.py 445B
2.py 425B
2.py 422B
4.py 408B
3.py 406B
4.py 404B
1.py 401B
5.py 356B
4.py 336B
2.py 332B
3.py 327B
4.py 326B
2.py 324B
2.2.py 317B
2.3.py 286B
2.1.py 285B
7.py 259B
3.py 211B
ciyun1.py 209B
1.py 207B
共 147 条
- 1
- 2
资源评论
阿齐Archie
- 粉丝: 1w+
- 资源: 2301
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- kernel-ml-6.8.8-1.el7.elrepo.x86-64.rpm
- Labview基本框架之状态机
- HM2309B-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- Git安全实践:保护你的代码仓库个人学习笔记.md
- 自动驾驶定位系列教程九:后端优化.pdf
- 三国志5威力加强版-windows
- HM2309A-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM2306-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- Git进阶技巧:提升团队协作效率个人学习笔记.md
- 自动驾驶定位系列教程八:建图系统结构优化.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功