Zed-King Study app · Free
O Level students across India practise here, free
Google login · no Play Store needed
About this PDF
Model test paper 3 for O Level M3-R5.1 — a mixed Python practice paper covering sequence data types, functions and control flow in the NIELIT question style.
This is part of the free O Level M3-R5.1 study material in the Zed-King Study Zone. You can read every page above in your browser, or download the file and study offline. Zed-King Group of Institute is a NIELIT Study Centre in Kaithal, Haryana, and all of this material follows the current NIELIT syllabus.
- Course
- O Level — NIELIT Foundation Diploma
- Module
- M3 — M3-R5.1: Programming and Problem Solving through Python
- Section
- Model Test Papers
- Format
- PDF — read online or download
- Price
- Free, no sign-up required
Text from this PDF
The opening pages as plain text — open the reader above for tables, diagrams and the full file.
1 .What will be the output of the following Python code?
class Count:
def __init__(self, count = 0):
self.__count = count c1 = Count(2)
c2 = Count(2)
print(id(c1) == id(c2), end = " ")
s1 = "Good" s2 = "Good" print(id(s1) == id(s2))
A)True True B)False False
C)True False D)False True
2 .What function do you use to read a string? · A)input(“Enter a string”) B)enter(“Enter a string”) · C)eval(input(“Enter a string”)) D)eval(enter(“Enter a string”))
3 .What will be the output of the following Python code? · A)Hello foo and bin B)Hello and
4 .What will be the output of the following Python code?
print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))
A)Error B)Hello foo and bin
C)Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) D)None of the above
5 .What will be the output of the following Python code snippet?
Model Test Paper 3 print('{:,}'.format(223334))
C)1,2,223,334 D)Error
6 .What will be the output of the following Python code?
print('{0:.2%}'.format(1/3))
7 .What will be the output of the following Python code?
print('a B'.isalpha())
C)None D)Error
8 .What will be the output of the following Python code snippet?
print('my_string'.isidentifier())
9 .What will be the output of the following Python code snippet?
print('cd'.partition('cd'))
10 .What will be the output of the following Python code snippet?
print('abcdef'.replace('cd', ''))
A)abef B)abcdef
C)abefcd D)None of the above
11 .What will be the output of the following Python code snippet?
print('abcdefcdghcd'.split('cd'))
A)[‘ab’, ‘ef’, ‘gh’] B)[‘ab’, ‘ef’, ‘gh’, ”]
C)(‘ab’, ‘ef’, ‘gh’) D)(‘ab’, ‘ef’, ‘gh’, ”)
12 .Which of the following commands will create a list? · A)list1 = [] B)list1 = list() · C)list1 = list([1, 2, 3]) D)all of the mentioned
13 .Suppose list1 is [2445,3,454,3], what is max(list1)?
14 .To shuffle the list(say list1) what function do we use? · A)shuffle(list1) B)list1.shuffle() · C)random.shuffle(list1) D)random.shuffleList(list1)
15 .Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
16 .Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:
17 .What will be the output of the following Python code?
>>>list1 < list2 is
C)Error D)None of the above
18 .To remove string “hello” from list1, we use which command? · A)list1.remove(“hello”) B)list1.remove(hello) · C)list1.removeAll(“hello”) D)list1.removeOne(“hello”)
19 .Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)?
20 .Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34,
21 .What will be the output of the following Python code?
>>>"Welcome to Python".split()
A)[“Welcome”, “to”, “Python”] B)(“Welcome”, “to”, “Python”)
C){“Welcome”, “to”, “Python”} D)“Welcome”, “to”, “Python”
22 .What will be the output of the following Python code?
max = myList[0] indexOfMax = 0 for i in range(1, len(myList)):
if myList[i] > max:
max = myList[i] indexOfMax = i >>>print(indexOfMax)
23 .What will be the output of the following Python code?
for i in range(1, 6):
for i in range(0, 6):
print(myList[i], end = " ")
24 .What will be the output of the following Python code?
def f(values):
values[0] = 44 f(v)
print(v)
25 .What will be the output of the following Python code?
>>>m = [[x, x + 1, x + 2] for x in range(0, 3)]
26 .What will be the output of the following Python code?
v = values[0][0] for row in range(0, len(values)):
for column in range(0, len(values[row])):
if v < values[row][column]:
v = values[row][column] print(v)
27 .What will be the output of the following Python code?
for row in values:
row.sort()
for element in row:
print(element, end = " ")
print()
A)The program prints on row 3 4 5 1 33 6 1 2
B)The program prints two rows 3 4 5 1 followed by 33 6 1 2
C)The program prints two rows 3 4 5 1 followed by 33 6 1 2
D)The program prints two rows 1 3 4 5 followed by 1 2 6 33
28 .What will be the output of the following Python code?
def m(list):
v = list[0] for e in list:
if v < e: v = e return v for row in values:
print(m(row), end = " ")
29 .What will be the output of the following Python code?
def ttt(m):
for row in m:
for element in row:
More model test papers for M3-R5.1
Run these Python programs yourself — free
Reading code is not the same as writing it. Type any program from these notes into our free online Python compiler (real Python 3 with NumPy, input() works), or study one of the explained programs with its output.
Prepare for O Level with expert guidance
Classroom training, practical labs and exam registration at Zed-King Institute, Kaithal.
