Categories

Dec 14, 2019 in Python

Q: What Are The Optional Statements Possible Inside A Try-Except Block In Python?

1 Answer

Dec 14, 2019

There are two optional clauses you can use in the try-except block.

The “else” clause

It is useful if you want to run a piece of code when the try block doesn’t create an exception.

The “finally” clause

It is useful when you want to execute some steps which run, irrespective of whether there occurs an exception or not.

Click here to read more about Python
Click here to read more about Insurance

Related questions

Madanswer
Aug 29 in Python
Oct 18, 2019 in C Sharp (C#)
Jun 12 in Python
...