Page 1
PERIODIC TEST
QUESTION PAPER
Question Paper for CBSE Board, KV Schools,
State Board following NCERT Syllabus
PT 1 | PT 2
Page 2
Question Paper based on NCERT Syllabus
CBSE Board Question Paper / KV Schools Question Paper
UNIT TEST – 1 (Session 2024-25)
CLASS -12 SUB – COMPUTER SCIENCE Time: 1.5 hr MM:- 40
General Instructions:
All Questions are compulsory.
Section A ( 2*7=14 )
A. Multiple Choice Questions.
1. Raman has declared a tuple T in Python as
following: T=(10,20,30)
Now, he wants to insert an element 40 after these three elements of T so that the tuple may contain (10, 20,
30, 40).
Which of the following statements shall Nitesh write to accomplish the above task ?
a) T = T+40 b) T = T + (40) c) T = T+(40,) d) None, since tuple are immutable
2. Suppose the content of a text file Notes.txt is :
“ The way to get started is to quit talking and begin doing”
F= open(“Notes.txt”)
F.seek(8)
S = F.read()
print(S)
a) The way to get started is to b) quit talking and begin doing
c) The way to get started is to quit talking and begin doing d) to get started is to quit talking and begin doing
3. Assertion(A): List is an immutable data type
Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is
destroyed and a new variable is created by the same name in memory.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False (d) A is false but R is True
4. State True or False:
“In a Python program, if a break statement is given in a nested loop, it terminates the execution of all loops in
one go.”
5. What is the first thing to do before performing any functions on a text file?
a. Import modules b. Open file c. Read file d. Print the name of the file
6 Which of the following is a wrong way of defining a function:-
a)def f(x=10, y=20, z=30): b)def f(x, y, z): c) def f(x=10, y, z): d def f(x, y=20, z=30):
7. Which of the following will delete key-value pair for key = “Red” from a dictionary D1?
a. delete D1("Red") b. del D1["Red"] c. del.D1["Red"] d. D1.del["Red"]
Section B(3*4=12)
8. (a) Given is a Python string declaration:
Mystring="##ProgrammingLanguagePython@
@" Write the output of: print(Mystring [2:18])
Page 3
(b) Write the output of the code given below:
D = {"ID": "P1", "Name": “ABC ”}
D['Age'] = 25
D['Address'] = "Delhi"
print(D.items( ))
9. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in
the code.
10. What is the difference between text and binary files? Explain.
Section C (3*2=6)
11. Differentiate between the following.
a) Actual and formal parameter
b) write and writelines() method or split() and partition() method
12. Write a function in python to count the number of lines in a text file “STORY.TXT” which is starting with
an alphabet ‘B’. or
Write a function in python that counts the number of “Me” or “My” words present in a text file
“STORY.TXT” contents are as follows:
My first book
Was Me and
My Family. It
Gave me
Chances to be known to the world.
The output of the function should be :
Count of Me/ My in file :
Section D(2*4=8)
13. A) Write the use and syntax for the following method.
a) open( ) b) tell( )
14. Write a function in Python to read a text file, Alpha.txt and displays those lines which begin with the word ‘You’.
AglaSem Earn while Learn Program. Send your papers and get paid.
Contact: support@
Page 4
QUESTION PAPERS
GET PREVIOUS YEAR QUESTION PAPERS FOR ALL CLASSES FOR CBSE, ISCSE, ISC AND ALL ALL
STATE BOARDS HERE AT
Andhra Pradesh Board Question Papers
BOARD
WISE Assam Board Question Papers
Bihar Board Question Papers
Chhattisgarh Board Question Papers
Goa Board Question Papers
Gujarat Board Question Papers
Haryana Board Question Papers
Himachal Pradesh Board Question Papers
J&K State Board Question Papers
Jharkhand Board Question Papers
Karnataka Board Question Papers
Kerala Board Question Papers
Madhya Pradesh Board Question Papers
Maharashtra State Board Question Papers
Manipur Board Question Papers
Meghalaya Board Question Papers
Mizoram Board Question Papers
Nagaland Board Question Papers
Orissa Board Question Papers
Punjab Board Question Papers
Rajasthan Board Question Papers
Tamil Nadu Board Question Papers
Telangana State Board Question Papers
Tripura Board Question Papers
Uttarakhand Board Question Papers
Uttar Pradesh (UP) Board Question Papers
West Bengal (WB) Board Question Papers