Try / Except / Else / Finally Functions in Python 3

Error Handling in Python 3


When you run a program, there are time when you experience a runtime error. These are experienced because the input might not be appropriate according to a data type or file which you may be opening does not exit or some math error occurs ( there can be several other reason for runtime errors).

But the Try function in Python lets us to properly manage the error through error handling. Try keyword and except keyword are complementary to each other. If any runtime error is experienced while running the Try block the Except block is runs, where you can five a customised error message or you can even writing another alternate piece of code.

Comments

Popular posts from this blog

Bubble Sort ( C & Python 3)

Comparison Logical and Bitwise Operator ( Java Part - 4 )

Something about me