Edzy
AI TutorResourcesToolsCompareBuy
SearchDownload AppLogin
Edzy

Edzy for Classes 6-12

Edzy is a personal AI tutor for CBSE and State Board students, with curriculum-aligned guidance, practice, revision, and study plans that adapt to each learner.

  • Email: always@edzy.ai
  • Phone: +91 96256 68472
  • WhatsApp: +91 96256 68472
  • Address: Sector 63, Gurgaon, Haryana

Follow Edzy

Browse by Class

  • CBSE Class 6
  • CBSE Class 7
  • CBSE Class 8
  • CBSE Class 9
  • CBSE Class 10
  • CBSE Class 11
  • CBSE Class 12
Explore the CBSE resource hub

Explore Edzy

  • Study Resources
  • Free Study Tools
  • Best Apps for Board Exams
  • Edzy vs ChatGPT
  • About Us
  • Why We Built Edzy
  • Blog
  • CBSE AI Tutor

Support & Legal

  • Help & FAQs
  • Accessibility
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy
  • Cookie Policy
  • Site Directory

© 2026 Edzy. All rights reserved.

Curriculum-aligned learning paths for students in Classes 6-12.

CBSE
Class 12
Computer Science
Computer Science
Exception Handling in Python

Question Bank

Practice Hub

Question Bank: Exception Handling in Python

This chapter covers the concepts of exception handling in Python, explaining how to manage and respond to errors while programming, which is crucial for creating robust applications.

Structured practice
Question Practice

Practice chapter questions in a cleaner, exam-ready flow

Start with curated question sets, move into full module views when needed, and keep discovering related practice without losing your place in the chapter.

Question Bank - Exception Handling in Python

View all (103)
Q1.

What is an exception in Python?

Single Answer MCQ
Q-00094521
View explanation
Q2.

What happens when a syntax error is encountered in a Python program?

Single Answer MCQ
Q-00094522
View explanation
Q3.

Which of the following types of errors cannot be caught by exception handling?

Single Answer MCQ
Q-00094523
View explanation
Q4.

Which of the following is a method to raise an exception in Python manually?

Single Answer MCQ
Q-00094524
View explanation
Q5.

What block of code is used to handle exceptions in Python?

Single Answer MCQ
Q-00094525
View explanation
Q6.

Which Python keyword is used to ensure that some code always runs after handling exceptions?

Single Answer MCQ
Q-00094526
View explanation
Q7.

What type of Python error occurs when you divide by zero?

Single Answer MCQ
Q-00094527
View explanation
Q8.

How do you access the error message from an exception in Python?

Single Answer MCQ
Q-00094528
View explanation
Q9.

What will happen if an exception is not handled in Python?

Single Answer MCQ
Q-00094529
View explanation
Q10.

Which of the following statements about exception handling is true?

Single Answer MCQ
Q-00094530
View explanation
Q11.

In Python, what is the syntax for defining a custom exception?

Single Answer MCQ
Q-00094531
View explanation
Q12.

What does the following code snippet do? 'try: x = 1 / 0 except ZeroDivisionError: print('Division by zero error')'

Single Answer MCQ
Q-00094532
View explanation
Q13.

What keyword is used to catch exceptions in Python?

Single Answer MCQ
Q-00094533
View explanation
Q14.

Which of the following is NOT a built-in exception in Python?

Single Answer MCQ
Q-00094534
View explanation
Q15.

What is a syntax error in Python?

Single Answer MCQ
Q-00094565
View explanation
Q16.

Which of the following will cause a syntax error in Python?

Single Answer MCQ
Q-00094566
View explanation
Q17.

How does Python indicate a syntax error when you run your program?

Single Answer MCQ
Q-00094567
View explanation
Q18.

What happens when a syntax error is detected in the code?

Single Answer MCQ
Q-00094568
View explanation
Q19.

Which error type specifically checks for incorrect rules in syntax?

Single Answer MCQ
Q-00094569
View explanation
Q20.

Which of the following statements contains a syntax error?

Single Answer MCQ
Q-00094570
View explanation
Q21.

What does the term 'parsing errors' refer to?

Single Answer MCQ
Q-00094571
View explanation
Q22.

Choose the option that best describes a common source of syntax errors in Python.

Single Answer MCQ
Q-00094572
View explanation
Q23.

What would be the output if the following code has a syntax error: print('Hello World'?

Single Answer MCQ
Q-00094573
View explanation
Q24.

Why must syntax errors be fixed before running a Python program?

Single Answer MCQ
Q-00094574
View explanation
Q25.

In case of a syntax error, what action does the Python interpreter take?

Single Answer MCQ
Q-00094575
View explanation
Q26.

Which of the following would NOT result in a syntax error?

Single Answer MCQ
Q-00094576
View explanation
Q27.

What is the effect of multiple syntax errors in a single Python script?

Single Answer MCQ
Q-00094577
View explanation
Q28.

What is the correct way to format an if statement in Python to avoid syntax errors?

Single Answer MCQ
Q-00094578
View explanation
Q29.

How can syntax errors affect program debugging?

Single Answer MCQ
Q-00094579
View explanation
Q30.

What type of error is raised when a division by zero occurs in Python?

Single Answer MCQ
Q-00094580
View explanation
Q31.

What must be used in Python to handle exceptions gracefully?

Single Answer MCQ
Q-00094581
View explanation
Q32.

Which exception is raised when trying to access an index that is out of range in a list?

Single Answer MCQ
Q-00094582
View explanation
Q33.

What will happen if the 'except' block does not match any raised exception?

Single Answer MCQ
Q-00094583
View explanation
Q34.

Which exception is raised when a module cannot be imported in Python?

Single Answer MCQ
Q-00094584
View explanation
Q35.

How can multiple exceptions be handled in a single block in Python?

Single Answer MCQ
Q-00094585
View explanation
Q36.

What kind of error is raised when the end of a file is reached without reading any data?

Single Answer MCQ
Q-00094586
View explanation
Q37.

What does the 'raise' statement do in Python?

Single Answer MCQ
Q-00094587
View explanation
Q38.

Which exception indicates that an operation has been performed on the wrong data type?

Single Answer MCQ
Q-00094588
View explanation
Q39.

In Python, what does a finally block do?

Single Answer MCQ
Q-00094589
View explanation
Q40.

What exception is raised when a local variable is not defined?

Single Answer MCQ
Q-00094590
View explanation
Q41.

Consider the code: 'print(10 + '5')'. What exception will be raised?

Single Answer MCQ
Q-00094591
View explanation
Q42.

If you want to ensure code execution occurs after a try-except block, what should be used?

Single Answer MCQ
Q-00094592
View explanation
Q43.

Which of the following indicates incorrect indentation in your code?

Single Answer MCQ
Q-00094593
View explanation
Q44.

What will the output be if a non-integer value is entered where an integer is expected?

Single Answer MCQ
Q-00094594
View explanation
Q45.

What is a user-defined exception?

Single Answer MCQ
Q-00094595
View explanation
Q46.

What exception is raised when an invalid index is accessed in a list?

Single Answer MCQ
Q-00094596
View explanation
Q47.

Which built-in exception is triggered by incorrect indentation?

Single Answer MCQ
Q-00094597
View explanation
Q48.

What does the EOFError signify in a Python program?

Single Answer MCQ
Q-00094598
View explanation
Q49.

Which exception is raised when an operation is performed on an unsupported data type?

Single Answer MCQ
Q-00094599
View explanation
Q50.

What happens when a denominator of zero is used in a division operation?

Single Answer MCQ
Q-00094600
View explanation
Q51.

What does the ImportError exception indicate?

Single Answer MCQ
Q-00094601
View explanation
Q52.

Which of the following exceptions could occur when trying to access a variable that has not been defined?

Single Answer MCQ
Q-00094602
View explanation
Q53.

When is the OverflowError raised?

Single Answer MCQ
Q-00094603
View explanation
Q54.

In what scenario would a KeyboardInterrupt be raised?

Single Answer MCQ
Q-00094604
View explanation
Q55.

Identify the built-in exception that is raised when there is an issue with the data type used in an expression.

Single Answer MCQ
Q-00094605
View explanation
Q56.

Which of the following statements correctly describes an ImportError?

Single Answer MCQ
Q-00094606
View explanation
Q57.

When is a ValueError raised in Python?

Single Answer MCQ
Q-00094607
View explanation
Q58.

What will be the output of the following code snippet if 'num' is not defined? print(num)

Single Answer MCQ
Q-00094608
View explanation
Q59.

What type of exception would be raised by the following code? print(7 / 0)

Single Answer MCQ
Q-00094609
View explanation
Q60.

What exception is likely to be raised when attempting to access a nonexistent key in a dictionary?

Single Answer MCQ
Q-00094610
View explanation
Q61.

Which of the following is used to handle exceptions in Python?

Single Answer MCQ
Q-00094611
View explanation
Q62.

What will be the output if a ZeroDivisionError occurs?

Single Answer MCQ
Q-00094612
View explanation
Q63.

What exception is raised when trying to convert a non-numeric string to an integer?

Single Answer MCQ
Q-00094613
View explanation
Q64.

Which statement is used to manually raise an exception in Python?

Single Answer MCQ
Q-00094614
View explanation
Q65.

What is the primary purpose of the raise statement in Python?

Single Answer MCQ
Q-00094615
View explanation
Q66.

How can you catch all exceptions in Python without specifying their types?

Single Answer MCQ
Q-00094616
View explanation
Q67.

Which of the following is a built-in exception in Python?

Single Answer MCQ
Q-00094617
View explanation
Q68.

What is the purpose of the 'finally' clause in exception handling?

Single Answer MCQ
Q-00094618
View explanation
Q69.

What happens when an exception is raised using the raise statement?

Single Answer MCQ
Q-00094619
View explanation
Q70.

What will happen if an exception is raised and not caught?

Single Answer MCQ
Q-00094620
View explanation
Q71.

What is a common syntax for raising a custom exception in Python?

Single Answer MCQ
Q-00094621
View explanation
Q72.

In Python, which of the following is a built-in exception?

Single Answer MCQ
Q-00094622
View explanation
Q73.

When using the raise statement without any parameters, what is the expected outcome?

Single Answer MCQ
Q-00094623
View explanation
Q74.

When a try block is executed, what happens if no exceptions occur?

Single Answer MCQ
Q-00094624
View explanation
Q75.

In which scenario would you typically use the raise statement?

Single Answer MCQ
Q-00094625
View explanation
Q76.

Where should an except clause be placed to handle exceptions appropriately?

Single Answer MCQ
Q-00094626
View explanation
Q77.

Which of the following statements correctly raises a ZeroDivisionError?

Single Answer MCQ
Q-00094627
View explanation
Q78.

What does the 'else' clause do in a try...except...else structure?

Single Answer MCQ
Q-00094628
View explanation
Q79.

Which statement is true regarding user-defined exceptions?

Single Answer MCQ
Q-00094629
View explanation
Q80.

What is the correct syntax to handle a specific exception in Python?

Single Answer MCQ
Q-00094630
View explanation
Q81.

If an exception is raised in a function and it is not handled within that function, what happens?

Single Answer MCQ
Q-00094631
View explanation
Q82.

Which built-in function can be used to create an assertion in Python?

Single Answer MCQ
Q-00094632
View explanation
Q83.

Which of the following is NOT a valid reason to raise an exception?

Single Answer MCQ
Q-00094633
View explanation
Q84.

What exception is typically used for handling unexpected input types?

Single Answer MCQ
Q-00094634
View explanation
Q85.

In exception handling, what is the purpose of the finally block?

Single Answer MCQ
Q-00094635
View explanation
Q86.

In the try-except-finally structure, what executes last?

Single Answer MCQ
Q-00094636
View explanation
Q87.

What is the typical way to create a user-defined exception class in Python?

Single Answer MCQ
Q-00094637
View explanation
Q88.

What will happen if a raised exception is not caught in a program?

Single Answer MCQ
Q-00094638
View explanation
Q89.

What is the primary purpose of the finally clause in Python?

Single Answer MCQ
Q-00094655
View explanation
Q90.

When is the finally block executed in a try-except-finally structure?

Single Answer MCQ
Q-00094656
View explanation
Q91.

In which sequence should the finally block be placed in relation to try and except blocks?

Single Answer MCQ
Q-00094657
View explanation
Q92.

What happens if an exception is not handled by the except blocks but a finally block is present?

Single Answer MCQ
Q-00094658
View explanation
Q93.

What message will always print if a finally block is executed?

Single Answer MCQ
Q-00094659
View explanation
Q94.

What is the correct syntax for a try-except-finally block in Python?

Single Answer MCQ
Q-00094660
View explanation
Q95.

Which of the following is NOT a reason to use a finally block?

Single Answer MCQ
Q-00094661
View explanation
Q96.

In a case where no except clause catches an exception, which of the following occurs?

Single Answer MCQ
Q-00094662
View explanation
Q97.

If you have an exception handling structure with try, except, and finally, but no else block, what will happen if no errors occur?

Single Answer MCQ
Q-00094663
View explanation
Q98.

Which exception will be raised if you try to divide by zero in a try block without handling it?

Single Answer MCQ
Q-00094664
View explanation
Q99.

Why is it advisable to use finally blocks while working with files?

Single Answer MCQ
Q-00094665
View explanation
Q100.

Which of the following statements is true regarding the finally clause?

Single Answer MCQ
Q-00094666
View explanation
Q101.

In a properly structured try-except-finally statement, what is executed last during the program's flow?

Single Answer MCQ
Q-00094667
View explanation
Q102.

If the finally block contains return statements, what happens?

Single Answer MCQ
Q-00094668
View explanation
Q103.

What output can you expect from this segment of code if the denominator input is invalid?

Single Answer MCQ
Q-00094669
View explanation
Learn Better On The App
Practice-first experience

Practice Makes Perfect

Sharpen concepts with MCQs, quizzes, and focused topic-based practice.

Endless questions
Topic-wise prep

Faster access to practice, revision, and daily study flow.

Edzy mobile app preview