Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
333 views
in Computer by (49.6k points)
closed by

Built-In Exceptions.

1 Answer

+1 vote
by (51.9k points)
selected by
 
Best answer

Commonly occurring exceptions are usually defined in the compiler/interpreter. These are called built-in exceptions. 

Python’s standard library is an extensive collection of built-in exceptions that deals with the commonly occurring errors (exceptions) by providing the standardized solutions for such errors. On the occurrence of any built-in exception, the appropriate exception handler code is executed which displays the reason along with the raised exception name. The programmer then has to take appropriate action to handle it. Some of the commonly occurring built-in exceptions that can be raised in Python are explained in Table.

Built-in exceptions in Python

Figure shows the built-in exceptions viz, ZeroDivisionError, NameEError, and TypeError raised by the Python interpreter in different situations.

Example of built-in exceptions

A programmer can also create custom exceptions to suit one’s requirements. These are called user-defined exceptions. We will learn how to handle exceptions in the next section.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...