Add number_guesse.py feature

未关闭 适合新手
#3,188 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
cli

调研方向

首先查看仓库贡献指南,并确认预期的独立文件名,因为标题写的是 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

geekcomputers/Python 的其他 Issue

查看 geekcomputers/Python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。