Errors And Exceptions

Answer:

The exceptions which can be generated by the interpreter or built-in functions are called as built-in exceptions.

Examples:

  • ImportError
  • IndexError
  • KeyError
  • ValueError
  • NameError
  • OSError
  • RuntimeError
  • SystemError
  • UnicodeError
  • IOError
Discuss It

Answer:

Exception can be any condition in a program resulting to the disruption in the flow of the program. Whenever an exception occurs the program halts the execution and thus further code is not executed. Thus exception is that error which python script is unable to tackle with.

Discuss It

Answer:

A finally block is always executed before leaving the try statement, whether an exception has occurred or not. When an exception has occurred in the try clause and has not been handled by an except clause. It is re-raised after the finally clause has been executed. The finally clause is also executed “on the way out” when any other clause of the try statement is left via a break, continue or return statement.

Discuss It

Quiz

on
Errors and Exceptions

Tutorial

on
Errors and Exceptions

Programs

on
Errors and Exceptions
Click any Link
to navigate to certain page easily
Write a line to us
Your Email
Title
Description