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
Advertisement
Answer
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.