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

Questions by norman   answers by norman

Showing Answers 1 - 6 of 6 Answers

xeio

  • Sep 25th, 2007
 

try ... except (...) ... [finally]

  Was this answer useful?  Yes

Priya Patel

  • Oct 20th, 2007
 

There are 2 optional clauses used in try...except statements:
1. else clause: It is useful for code that must be executed when the try block doesn't create any exception
2. finally clause:Its is useful for code that must be executed irrespective of whether an exception is generated or not.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions