selfteaching / selfteaching/selfteaching-python-camp
Day08 如何主动抛出异常?
Open
Nobody has claimed this yet.
学习心得分享
- Dominant language
- Python
- Stars
- 151
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
if 程序异常检查==True:
raise 错误类型 ( ' 错误说明 ' )
例子:
如果number是负数,则抛出ValueError:
if number<0:
raise ValueError('It's a negative number!')
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
Start with the Day08 lesson content and review the issue's explanation of raising exceptions. Confirm that the syntax and negative-number ValueError example are clearly presented, then verify the lesson communicates what the example demonstrates. No file or test is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100