Add number_guesse.py feature
还没有人认领这个 Issue。
评估
调研方向
首先查看仓库贡献指南,并确认预期的独立文件名,因为标题写的是 number_guesse.py,而解决方案要求使用 number_guessing.py。完成的标准是:该文件提供指定的上限输入、随机秘密数字、带验证的重复猜测和 Too High/Too Low 提示,并使用所要求的适合初学者的结构给出最终猜测次数。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem?
Currently the repository lacks an interactive
number guessing game implementation. There is no
example that demonstrates random number generation
combined with user input validation and game loop
logic in a beginner-friendly way.
Describe the Solution
Add a number_guessing.py file that implements a
complete number guessing game where:
- User defines the upper bound of the range
- Program generates a secret random number
- User guesses repeatedly until correct
- Program responds with "Too High" or "Too Low" hints
- Final score shows total number of guesses taken
Describe Alternatives
An alternative would be to add this as part of an
existing file, however a standalone file keeps the
code clean, readable, and easy to understand for
beginners learning Python fundamentals.
Additional Context
This is a classic beginner algorithm that covers:
- random module usage
- Input validation
- While loops
- Conditional statements
- Function design with type hints
The file will follow all repository contribution
guidelines including proper docstrings and clean
code structure.
Complexity
- Simple (< 50 lines)
- Medium (50-200 lines)
- Complex (> 200 lines)
- 主要语言
- Python
- 星标
- 35.4k
- 派生
- 12.9k
- 平均合并
- 2 小时 37 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
geekcomputers/Python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
geekcomputers/Python#3205 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
geekcomputers/Python#3060 · 1 条评论 ·
-
[BUG] shapchat 未关闭
难度 5/5 一周以上 新手友好度 10/100
geekcomputers/Python#3214 · 5 条评论 ·
-
Test of an Issue 未关闭
难度 5/5 一周以上 新手友好度 10/100
geekcomputers/Python#3209 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 10/100
geekcomputers/Python#3185 ·
查看 geekcomputers/Python 的全部 Issue
相似的 Issue
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 90/100
simonw/sqlite-utils#872 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100