-
Notifications
You must be signed in to change notification settings - Fork 115
Labels
enhancementNew feature or requestNew feature or requesthacktoberfest-acceptedlevel 110 points10 pointsrecodethis is label for leaderboardthis is label for leaderboard
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Feature Description
This feature request is to add a new documentation page covering Exception Handling in Python. The page would be a new markdown file, python-exceptions.md, that explains how to manage errors. It is mentioned briefly in the "Typecasting" portion of the course
(ref :
recode-website/docs/python/python-casting.md
Lines 79 to 87 in 10a3af9
Use `try`/`except` to handle safely: | |
```python | |
value = "abc" | |
try: | |
number = int(value) | |
except ValueError: | |
print("Invalid conversion") | |
``` |
but I think a dedicated section for it with examples might work better.
Topics include :
- The purpose of the try...except block.
- How to catch specific exceptions (e.g., ValueError, ZeroDivisionError).
- The use of the optional else clause.
- The use of the finally clause for cleanup actions.
Use Case
Makes the python section more complete and comprehensive.
Benefits
Completes the curriculum
Add ScreenShots
No response
Priority
Low
Record
- I have read the Contributing Guidelines
- Are you a GSSOC'25 contributor
- I want to work on this issue
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfest-acceptedlevel 110 points10 pointsrecodethis is label for leaderboardthis is label for leaderboard
Type
Projects
Status
Done