NEW
Font size
WorksheetsPython_MCQ_2
Total questions: 15
Worksheet time: 14mins
How many except statements can a try-except block have?
zero
one
more than one
more than zero
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
print(t[3])
t[3] = 45
print(max(t))
print(len(t))
What will be the output of the following Python code?
(1, 2)
(1, 2, 4)
(2, 4)
(2, 4, 3)
What will be the output of the following Python code?
[1] [2] [3]
[1] [1, 2] [1, 2, 3]
[1, 2, 3]
1 2 3
What will be the output of the following Python code?
4
5
8
12
What will be the output of the following Python code?
True
False
Error
None
What will be the output of the following Python code?
30
24
33
12
What is the value of the following expression?
2+4.00, 2**4.0
(6.0, 16.0)
(6.00, 16.00)
(6, 16)
(6.00, 16.0)
What are the values of the following Python expressions?
64, 512, 64
64, 64, 64
512, 512, 512
512, 64, 512
What will be the output of the following Python code?
print('Hello!2@#World'.istitle())
True
False
None
Error
What will be the output of the following Python code?
4
5
1
An exception is thrown
What will be the output of the following Python code?
Integer
Tuple
Dictionary
An exception is thrown
If a function doesn’t have a return statement, which of the following does the function return?
int
null
None
An exception is thrown without the return statement
What will be the output of the following Python code?
212
32
9
27
567
98
None of the mentioned
What will be the output of the following Python code snippet?
Error, dictionary in a dictionary can’t exist
‘Numbers’: {1: 56, 3: 7}
{‘Numbers’: {1: 56}, ‘Letters’: {4: ‘B’}}
{‘Numbers’: {1: 56, 3: 7}, ‘Letters’: {4: ‘B’}}
