WorksheetsPython Day 10
Total questions: 7
Worksheet time: 4mins
Name
Class
Date
1.
The unexpected event happened during program execution should be handled by
a)
EXCEPTION
b)
EXPERIMENT
c)
ASSERTION
d)
EXTRAORDINARY
2.
Output if a=10, b =5?
a)
5.0
b)
Something Went Wrong
c)
Arithmetic Error
d)
2.0
3.
How many except statements can a try-except block have?
a)
zero
b)
one
c)
more than one
d)
more than zero
4.
When will the else part of try-except-else be executed?
a)
always
b)
when an exception occurs
c)
when no exception occurs
d)
when an exception occurs in to except block
5.
What will be the output of the following Python code?
lst = [1, 2, 3]
lst[3]
a)
NameError
b)
ValueError
c)
IndexError
d)
TypeError
6.
What will be the output of the following Python code?
lst = [1, 2, 3]
print(t[5])
a)
NameError
b)
ValueError
c)
IndexError
d)
TypeError
7.
What will be the output of the following Python code
print(4 + '3')
a)
NameError
b)
ValueError
c)
IndexError
d)
TypeError
100 %
