Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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 operator in python evaluates to true if it does not finds a
variable in the specified sequence and false otherwise?
A - **
B - //
C - is
D - not in
Q 2 - Which of the following statement terminates the loop statement and transfers
execution to the statement immediately following the loop?
A - break
B - continue
C - pass
Q 3 - Which of the following statement causes the loop to skip the remainder of its
body and immediately retest its condition prior to reiterating?
A - break
B - continue
C - pass
B - continue
C - pass
Q 5 - Which of the following function returns a random item from a list, tuple, or
string?
A - choiceseq
C - random
D - seed[x]
A - choiceseq
C - random
D - seed[x]
Q 7 - Which of the following function returns a random float r, such that 0 is less than
or equal to r and r is less than 1?
A - choiceseq
C - random
D - seed[x]
Q 8 - Which of the following function sets the integer starting value used in
generating random numbers?
A - choiceseq
C - random
D - seed[x]
A - shufflelst
B - capitalize
C - isalnum
D - isdigit
A - shufflelst
B - capitalize
C - isalnum
D - isdigit
Q 11 - Which of the following function checks in a string that all characters are
alphanumeric?
A - shufflelst
B - capitalize
C - isalnum
D - isdigit
Q 12 - Which of the following function checks in a string that all characters are digits?
A - shufflelst
B - capitalize
C - isalnum
D - isdigit
Q 13 - Which of the following function checks in a string that all characters are in
lowercase?
A - islower
B - isnumeric
C - isspace
D - istitle
Q 14 - Which of the following function checks in a string that all characters are
numeric?
A - islower
B - isnumeric
C - isspace
D - istitle
Q 15 - Which of the following function checks in a string that all characters are
whitespaces?
A - islower
B - isnumeric
C - isspace
D - istitle
Q 16 - Which of the following function checks in a string that all characters are
titlecased?
A - islower
B - isnumeric
C - isspace
D - istitle
Q 17 - Which of the following function checks in a string that all characters are in
uppercase?
A - isupper
B - joinseq
C - lenstring
D - ljustwidth[, fillchar]
A - isupper
B - joinseq
C - lenstring
D - ljustwidth[, fillchar]
A - isupper
B - joinseq
C - lenstring
D - ljustwidth[, fillchar]
Q 20 - Which of the following function gets a space-padded string with the original
string left-justified to a total of width columns?
A - isupper
B - joinseq
C - lenstring
D - ljustwidth[, fillchar]
A - lower
B - lstrip
C - maxstr
D - minstr
A - lower
B - lstrip
C - maxstr
D - minstr
Q 23 - Which of the following function returns the max alphabetical character from the
string str?
A - lower
B - lstrip
C - maxstr
D - minstr
Q 24 - Which of the following function returns the min alphabetical character from the
string str?
A - lower
B - lstrip
C - maxstr
D - minstr
B - strip[chars]
C - swapcase
D - title
ANSWER SHEET
1 D
2 A
3 B
4 C
5 A
6 B
7 C
8 D
9 A
10 B
11 C
12 D
13 A
14 B
15 C
16 D
17 A
18 B
19 C
20 D
21 A
22 B
23 C
24 D
25 A
Loading [MathJax]/jax/output/HTML-CSS/jax.js