Friday , September 20 2024

If there is more than one except: branches after the try: clause, we can say that:

Questions BankCategory: Python Essentials 2If there is more than one except: branches after the try: clause, we can say that:
If there is more than one except: branches after the try: clause, we can say that:

  • one or more except: blocks will be executed
  • exactly one except: block will be executed
  • none of the except: blocks will be executed
  • not more than one except: block will be executed

Explanation: At most, one of the except branches is executed – none of the except branches is performed when the raised exception doesn’t match the specified exceptions, or when no exception is raised at all.

More Questions: Python Essentials 2 (PE2) Course Final Test