jackfrued / jackfrued/Python-100-Days
循环部分--猜数游戏: int(answer) ValueError
Open
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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