'Python - Exception Handling
Till I know, Python exception handling includes four types of keyword (try, except, finally, Raise) + else. But I read some articles that say throw, catch keyword in Python. Really, Python has this keyword. I read these two official documentation for Exception Handling. But they did not mention that
Solution 1:[1]
No, they aren't. Other languages use throw to give out an exception, and use try-catch-finally to handle one. Python uses raise to give out an exception, and uses try-except-finally-else to handle one. You can't use try-catch-finally or throw in Python.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Frank Yang |
