Python Question:
Download Questions PDF

What is the optional statement used in a try except statement in Python?

Answer:

There are two optional clauses used in try except statements:

1. Else clause: It is useful for code that must be executed when the try block does not create any exception

2. Finally clause: It is useful for code that must be executed irrespective of whether an exception is generated or not.

Download Python Interview Questions And Answers PDF

Previous QuestionNext Question
What is python?What is used to create Unicode string in Python?