Skip to content

Commit a9e3a46

Browse files
committed
Updated Files
1 parent d372975 commit a9e3a46

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

contrib/advanced-python/exception-handling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exception Handling in Python
22

3-
Exception handling is a way of managing errors that may occur during program execution, through which you can handle exceptions gracefully. Python's exception handling mechanism has been designed to avoid unexpected termination of the program and offer a means to either regain control after an error or display meaningful messages to the user.
3+
Exception Handling is a way of managing the errors that may occur during a program execution. Python's exception handling mechanism has been designed to avoid the unexpected termination of the program, and offer to either regain control after an error or display a meaningful message to the user.
44

55
- **Error** - An error is a mistake or an incorrect result produced by a program. It can be a syntax error, a logical error, or a runtime error. Errors are typically fatal, meaning they prevent the program from continuing to execute.
66
- **Exception** - An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions. Exceptions are typically unexpected and can be handled by the program to prevent it from crashing or terminating abnormally. It can be runtime, input/output or system exceptions. Exceptions are designed to be handled by the program, allowing it to recover from the error and continue executing.
@@ -35,7 +35,7 @@ Here's an example to explain this:
3535

3636
```python
3737
try:
38-
# code that might raise an exception
38+
# Code that might raise an exception
3939
result = 10 / 0
4040
except:
4141
print("An error occured!")
@@ -72,7 +72,7 @@ Output
7272
Oops! You tried to divide by zero.
7373
```
7474

75-
If you comment on the line `result = 10 / 0`, then the output will be
75+
If you comment on the line `result = 10 / 0`, then the output will be:
7676

7777
```markdown
7878
There's a variable named 'undefined_variable' that hasn't been defined yet.

contrib/advanced-python/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
- [Regular Expressions in Python](regular_expressions.md)
88
- [JSON module](json-module.md)
99
- [Map Function](map-function.md)
10+
- [Exception Handling in Python](exception-handling.md)

0 commit comments

Comments
 (0)