PCEP Section 4C: Python Built-In Exceptions Hierarchy
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Misti McDaniel
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the top-most class in Python’s built-in exception hierarchy?
Exception
BaseException
SystemExit
RuntimeError
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the direct parent class of the `IndexError` exception in Python?
LookupError
ValueError
ArithmeticError
Exception
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which exception is raised when the `del` statement is used on a dictionary key that does not exist?
IndexError
KeyError
ValueError
TypeError
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following exceptions is NOT a subclass of `Exception`?
SystemExit
ValueError
TypeError
IndexError
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which exception is raised when an operation or function is applied to an object of inappropriate type?
ValueError
TypeError
KeyError
LookupError
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes an "abstract exception" in Python’s built-in exception hierarchy?
An exception that cannot be instantiated directly and is meant to be subclassed.
An exception that is only used for mathematical errors.
An exception that is raised for keyboard interrupts.
An exception that is used for system exit events.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose you have the following code: ```python try: print(1 / 0) except Exception as e: print("Caught:", type(e).__name__) ``` What will be printed?
Caught: ArithmeticError
Caught: ZeroDivisionError
Caught: ValueError
Caught: TypeError
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Python Testing
Quiz
•
9th - 12th Grade
10 questions
Windows 10 Basics
Quiz
•
9th - 12th Grade
10 questions
ETWINNING SID EVENT 24
Quiz
•
1st - 12th Grade
14 questions
Software: Programming Languages
Quiz
•
10th - 12th Grade
20 questions
City & Guilds Award in Business Processes
Quiz
•
12th Grade
20 questions
Database Basics v2 N5
Quiz
•
1st - 12th Grade
10 questions
Quiz 9 (15.09.2021)
Quiz
•
1st - 12th Grade
17 questions
ICT Service Solutions 2
Quiz
•
8th - 12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
