jackfrued / jackfrued/Python-100-Days

循环部分--猜数游戏: int(answer) ValueError

Open
#388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
187k
Forks
55.8k
PR merge metrics
No merged PRs in 30d

Description

我有一个想法,用异常处理来解决ValueError:

    while True:
        a =  input('请输入一个数字:  ')
        try:
            a = int (a)
        except ValueError :
            print("  要输入数字哟")
        else:
            break

大家平时都是如何处理转换类型时“ValueError”的呢?

一定有比我的方法更简洁的吧

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is identified in the issue. Start by reading the guessing-game example and its input conversion, then clarify the intended change with the maintainers; completion cannot be defined until the scope is agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.