Quiz on Try and Except in Python
Q.1. A syntax error is a type of ______ error
Q.2. Which error is given out if there is a a mathematical error in the program?
Q.3. Which type of error will be given out
print("Hello World"
Q.4. The program in which error may occur is written in the except block
Q.5.Which keyword is used to intentionally create an exception or error?
Q.6. What is the output of following program?
a=5
b = int(input("Enter value of b:"))
try:
print(a/b)
except ArithmeticError:
print("Error")
Q.7. Can one Except statement handle multiple exceptions?
Q.8. The else part of try-except-else runs when
Q.9. What is the error raised when a built-in function is inputted with invalid data type?
Q.10. The else keyword can be used to convey to the user a message of?
Q.11. The try-except blocks can have multiple Except Statements
Q.12. What is the base class for all built-in exceptions?
Q.13. The finally block is exceuted when
Q.14. What is the output of the following snippet of code?
try:
print(1)
finally:
print(2)
Q.15. What is the output of the following snippet of code?
l = [1,2,3,4,5]
print(l[5])
Instructions:-
- This Quiz is based on Try and Except in Python
- Each correct answer will carry 2 points
- Once an option is selected you cannot select any other, So choose wisely
- Do not refresh the page as it will reset the quiz
- Once the time is up the quiz will automatically get submitted with no of Question responded
- Your total score alongwith your name will be shown after submission of the Quiz
- Wish you ALL THE BEST 👍👍
START
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP