selfteaching / selfteaching/selfteaching-python-camp

Day08 如何主动抛出异常?

Open
#646 1 comment 1 reaction 0 assignees View on GitHub

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.