Skip to main content

Exception Handling In Python — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Exception Handling In Python — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
11
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
14 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
11

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/11 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 11
★ FPSC ★ PPSC

Syntax errors are also known as parsing errors.

Question 2 of 11
★ FPSC ★ PPSC

The error displayed in the following Python code is? import itertools l1=(1, 2, 3) l2=[4, 5, 6] l=itertools.chain(l1, l2) print(next(l1))

Question 3 of 11
★ FPSC ★ PPSC

What will be the output of the following Python code? def f(x): for i in range(5): yield i g=f(8) print(list(g))

Question 4 of 11
★ FPSC ★ PPSC

What will be the output of the following Python code? try: if '1' != 1: raise "someError" else: print("someError has not occurred") except "someError": print ("someError has occurred")

Question 5 of 11
★ FPSC ★ PPSC

Is the following Python code valid? try: # Do something except: # Do something else: # Do something

Question 6 of 11
★ FPSC ★ PPSC

What will be the output of the following Python code, if the time module has already been imported? 4 + '3'

Question 7 of 11
★ FPSC ★ PPSC

Which of the following blocks will be executed whether an exception is thrown or not?

Question 8 of 11
★ FPSC ★ PPSC

. . . . . . . . exceptions are raised as a result of an error in opening a particular file.

Question 9 of 11
★ FPSC ★ PPSC

What will be the output of the following Python code? t[5]

Question 10 of 11
★ FPSC ★ PPSC

What happens if the file is not found in the following Python code? a=False while not a: try: f_n = input("Enter file name") i_f = open(f_n, 'r') except: print("Input file not found")

Question 11 of 11
★ FPSC ★ PPSC

Which of the following is true about the finally clause in exception handling?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →