Python Mock Test IV
Python Mock Test IV
This section presents you various set of Mock Tests related to Python. You can download these
sample mock tests at your local machine and solve offline at your convenience. Every mock test is
supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - Which of the following function removes all leading and trailing whitespace in
string?
B - strip[chars]
C - swapcase
D - title
Q 2 - Which of the following function changes case for all letters in string?
B - strip[chars]
C - swapcase
D - title
B - strip[chars]
C - swapcase
D - title
A - upper
B - isdecimal
C - swapcase
D - title
Q 5 - Which of the following function checks in a string that all characters are decimal?
A - upper
B - isdecimal
C - swapcase
D - title
A-1
B-2
C-3
D-4
A - [1, 2, 3, 4, 5, 6]
B - [1, 2, 3],[4, 5, 6]
C - [5, 7,9]
D - 21
B - ['Hi!'] * 4
C - Error
A - true
B - false
C - Error
B-123
C - Error
A-1
B-2
C-3
A-1
B-2
C-3
A - 2,3
B-2
C-3
A - cmplist1, list2
B - lenlist1, list2
C - maxlist1, list2
D - minlist1, list2
Q 15 - What is the following function gives the total length of the list?
A - cmplist
B - lenlist
C - maxlist
D - minlist
Q 16 - What is the following function returns item from the list with max value?
A - cmplist
B - lenlist
C - maxlist
D - minlist
Q 17 - What is the following function returns item from the list with min value?
A - cmplist
B - lenlist
C - maxlist
D - minlist
Q 18 - What is the following function returns the lowest index in list that obj appears?
A - list.indexobj
B - list.insertindex, obj
C - list.popobj = list[ − 1]
D - list.removeobj
A - list.indexobj
B - list.insertindex, obj
C - list.popobj = list[ − 1]
D - list.removeobj
A - list.indexobj
B - list.insertindex, obj
C - list.popobj = list[ − 1]
D - list.removeobj
A - list.indexobj
B - list.insertindex, obj
C - list.popobj = list[ − 1]
D - list.removeobj
A - list.reverse
B - list.sort[func]
C - list.popobj = list[ − 1]
D - list.removeobj
A - list.reverse
B - list.sort[func]
C - list.popobj = list[ − 1]
D - list.removeobj
A - dict1.cmpdict2
B - dict1.sortdict2
C - cmpdict1, dict2
A - maxdict
B - mindict
C - lendict
ANSWER SHEET
1 B
2 C
3 D
4 A
5 B
6 C
7 A
8 A
9 A
10 B
11 C
12 A
13 A
14 A
15 B
16 C
17 D
18 A
19 B
20 C
21 D
22 A
23 B
24 C
25 C
Loading [MathJax]/jax/output/HTML-CSS/jax.js