BRINDHAVAN SENIOR SECONDARY SCHOOL
(Affiliated to CBSE New Delhi – Affiliation No:193115 8 School code : 56063 )
GRADE :XII PERIODIC ASSESSMENT I (2026 – 2027) MARKS : 70
DATE : 10.4.26 COMPUTERSCIENCE TIME : 3.00 Hr
SECTION-A (21 X 1 = 21 MARKS)
[Link] will be the output of the following Python code?
N=([2,3],[4,5],[6,7])
N[2]=[10,20]
a) ([2,3],[4,5],[10,20]) b) ([2,3],[4,5],[20,10])
c) Type error d) [ ]
2. Accessing and processing each element of tuple is called as _______.
a) Concatenation b) Traversing
c) Sorting d)None of these
3. Creating a tuple from a set of values is called as _______.
a) Unpacking b) Packing
c) Merging d) None of these
4. Find the output of Python code
x=(3,4,5,6,7,8,12,14,16,18)
>>> x[::-2]
a) (18,14,8,6,4) b) (4,6,8,14,18)
c) (3,5,7,12,16) d) None of these
5. Find the element in S[-4] position of the given tuple
S=(3,5,6,8,9,10)
a) 5 b) 6
c) 3 d) 10
6Which of the following create an empty tuple?
a) a=tuple(). b) a=()
c) tuple=(). d) a==()
[Link] mode is not specified, which is the default mode of file?
a) Write mode. b) Read mode
c) Append mode. d) Binary mode
8. Find the suitable output of the following python code snippet.
L=[2,3,4,10]
>>>L+"abc"
>>>L
a) [2,3,4,10,abc]. b) [abc,2,3,4,10]
c) Error. d) None of these
9. Find the length of the following list.
L1=[1,3,5,[1,2],7]
>>>len(L1)
a) 5. b) 4
c) 3. d) 6
10. What will be the output of the following python code
last=[10,12,14,20,22,24,30,32,34]
>>>lst[0:10:2]
11. Which one of the following function of list is used to add more elements
at the end of the list?
a) append() b) extend()
c) insert(). d) pop()
12. If you want to insert single element at the end of the list,which is the
suitable function to do it?
a) append(). b) extend()
c) insert(). d) add()
13. What will be the output of the following code?
T2=[ ]
>>> [Link]( )
14. The _____ method removes the first occurence of given item from the
list.
a) pop(). b) clear()
c) remove(). d) reverse()
15. Which of the following method is used to delete the entire list?
a) del(). b) remove()
c) clear(). d) pop()
16. The process of converting Python object into byte stream is known as
_____.
a) Pickling. b) unpickling
c) load d) dump
17. Find the output of the following Python code
vowels=('a','e','i','o','u')
>>>vowels[-5]
18. Which one of the following is not an example of immutable data type?
a) String. b) Tuple
c) Integer. d) List
19. What kind of mode is used to add content at the end of file in which
existing information also remain in the file.
a) r. b)r+
c) a. d) w
20. Which method is used to move the content from buffer to file
immediately?
a) insert(). b) flush()
c) seek(). d) tell()
[Link] statement seek(-5,2) here offset value indicate ______.
a) beginning of the file. b) end of the file
c) middle of the file. d) None of the above
SECTION-B (7 X 2 = 14 MARKS)
22. Consider a list L1=[10,20,30,40]. If you want to add new element 50 at
index 1. Specify the suitable method.
23. How do you join two tuples together? Give suitable example
(Or)
Which is list Concatenation operator in python? Give suitable example.
24. Why tuple is called as immutable data type?
(Or)
Write the difference between. Text file and binary file.
25. Find the output from the Python code
F=(3,4,5,3,5,7,8,9,12,14).
>>> F[2:8]
>>>F[5:8]*3
26. How do you implement max() and min() functions in tuple?
(Or)
Given tuple S=(2,3,9,1,4) display the element from tuple in
descending
order using built-in function
27. What will be the output of tuple after slicing operation
tpl=(10,12,14,20,22,24,30,32,34)
>>>tpl[0:10:3]
28. What is the suitable method to create tuple with single element?
Give suitable example
SECTION-C (3 X 3 = 9 MARKS)
29. Explain five list related functions with example
S=[2,3,4,5,12,13,14,15,16,17]
i) delete single element from a list S
ii) delete a sublist from a list
iii) delete a entire list
(Or)
Differentiate read( ) and readlines() functions with suitable example.
30. How do we indirectly modifying a tuple give proper example?
(Or)
What will be the output of the following code segment
mylist=[1,2,3,4,5,6,7,8,9,10]
>>>del mylist[3:]
>>> print(mylist)
31. Give a tuple namely stock names as elements
('pen','pencil','note','book','laptop','eraser','ink')
Write a program to print names of the stock in the index range 2 to
[Link] inclusive
(Or)
Write a python program to read the text file '[Link]' and display the
lines start with vowels.
SECTION-D(4 X 4 = 16 MARKS)
32. Consider a list list1=[6,7,8,9]
What is the difference between the following operations on list1.
a) list1*2. b) list1*=2. c) list1=list1*2. d) len(list1)
(Or)
Difference between seek() and tell() method in python.
33. What will be the output of the following code segment.
mylist=[1,2,3,4,5,6,7,8,9,10]
for i in range(0,len(mylist)):
if i%2==0:
print(mylist[i]
34. Explain about index() and count() methods in tuple with example.
(Or)
Explain all types of modes in python.
35. A Python application allows users to register for an event. The program
collects Name, Email, and Phone number, and saves the data in a CSV
file.
(a) Name the Python module to manage files in CSV format.
(b) Write statements to open a CSV file in append mode and add a new
record.
(c) Suggest two ways to validate the Email or Phone number entered by
the user.
SECTION-E(2X 5 = 10 MARKS)
36. What is the output produced by following code?
obj = open("[Link]", "w")
[Link]("A poem by Paramhansa Yogananda")
[Link]("Better than Heaven or Arcadia")
[Link]("I love thee, O my India !")
[Link]("And thy love I shall give")
[Link]("To every brother nation that lives.")
[Link]()
obj1 = open("[Link]", "r")
s1 = [Link](48)
print(sl)
[Link]()
(or)
Explain the following methods related to List
I)sum() ii) Max() iii) Min() iv) concatenation v) Replication
37. Write a program with method countand() to count the word 'and' or
'And
as an independent word in a text file "[Link]". e.g. if the content of
the
file "status, txt" is as follows:
Welcome to your one-step solutions for all your study, practice
and assessment needs for various competitive & recruitment
examinations and school segment. We have been working tirelessly
for over a decade 4 [Link] 16 to make sure that you have
best in class study resources because you deserve SUCCESS AND
NOTHING LESS...
Then the output of the program should be: Count of _and_ in file is/are:
3