+++ csc201
+++ csc201
2
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 8 - Is python a case sensitive language?
A - true+++
B – false
C – can’t say
D – None of the above
Q 24 - matrix = [[45,23,7,-1],[56,22,51,89],
[23,56,77,80]]. What is the output of matrix[1][3]?
A – [[45,23,7,-1],[23,56,77,80]]
B – [[45,23,7,-1],[56,22,51,89],[23,56,77,80]]
C – 89+++
D – 51
A – {‘Apple’:4}
B – [‘Apple’:8]
C – {‘Apple’:8}+++
D – [‘Apple’:8]
E – {‘Apple’:4,’Apple’:8}
6
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 27 - What is the output of [‘box’]*3?
A – [‘box’][‘box’][‘box’]
B – [boxboxbox]
C – [‘box’,’box’,’box’]+++
D – [‘boxboxbox’]
8
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 36 - What is the output of print list if tuple = ′abcd′,
786, 2.23,′john′, 70.2?
A - ′abcd′, 786, 2.23, ′john′, 70.2+++
B - tuple
C - Error
D - None of the above.
12
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 54 - Which of the following function convert a
sequence of tuples to dictionary in
python?
A – set(x)
B – dict(d)+++
C – frozenset(s)
D – chr(x)
15
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 67 - Which of the following statement is used when a
statement is required syntactically but you do not want
any command or code to execute?
A - break
B - continue
C - pass+++
D - None of the above.
16
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
A – choice(seq)
B – randrange( [start, ]stop[, step])
C – random()
D – seed([x])+++
17
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 76 - Which of the following function checks in a string
that all characters are in lowercase?
A – islower()+++
B – isnumeric()
C – isspace()
D – istitle()
19
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 85 - Which of the following function removes all
leading whitespace in string?
A – lower()
B – lstrip()+++
C – max(str)
D – min(str)
ANS = B
21
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 94 - What is the output of len([1, 2, 3])?
A-1
B-2
C - 3+++
D-4
22
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 99 - What is the output of L[-2] if L = [1,2,3]?
A-1
B - 2+++
C-3
D - None of the above.
23
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 104 – Which of the following functions returns item
from the list with min value?
A - cmp(list)
B - len(list)
C - max(list)
D – min(list)+++
25
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS
Q 114 – D1 = {"john":40,"peter":45}
D2 = d = {"john":456,"peter":45}
What is the output of D1 > D2?
A - No
B – True
C – False+++
D – Syntax Error
A - [1, 2, 3]
B – [4,1,2,3]
C – [1,2,3,4]
D – [4,2,3]+++
26
COMPILED BY “OLUGBENGA” CONTACT 07035617005 FOR COMMENTS