0% found this document useful (0 votes)
5 views2 pages

XI_CS_PT2_2021-22

The document is a periodic test paper for Class XI Computer Science at Kendriya Vidyalaya Ambarnath, consisting of three sections with a total of 35 marks. Section A includes 7 questions worth 2 marks each, Section B has 3 questions worth 3 marks each, and Section C contains 3 questions worth 4 marks each. The questions cover various topics in Python programming, including data types, list and dictionary operations, and specific coding tasks.

Uploaded by

shreyapnashine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

XI_CS_PT2_2021-22

The document is a periodic test paper for Class XI Computer Science at Kendriya Vidyalaya Ambarnath, consisting of three sections with a total of 35 marks. Section A includes 7 questions worth 2 marks each, Section B has 3 questions worth 3 marks each, and Section C contains 3 questions worth 4 marks each. The questions cover various topics in Python programming, including data types, list and dictionary operations, and specific coding tasks.

Uploaded by

shreyapnashine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

KENDRIYA VIDYALAYA AMBARNATH

PERIODIC TEST 2 ( 2021-22)


CLASS: XI SUBJECT : COMPUTER SCIENCE
MARKS: 35 TIME: 2 Hrs
General Instructions
The question paper is divided into 3 sections – A, B and C
Section A, consists of 7 questions (1-7). Each question carries 2 marks. Section B, consists
of 3 questions (8-10). Each question carries 3 marks.
Section C, consists of 3 questions (11-13). Each question carries 4 marks.
Internal choices have been given for question numbers 7, 8 and 12.

Section -A
Each question carries 2 marks
1. TypeError occurs while statement 2 is running.Give reason. How can it be corrected?
>>> tuple1 = (5) #statement 1
>>> len(tuple1) #statement 2
2. Write 2 mutable and 2 immutable datatypes
3. Consider the following list myList. What will be the elements of myList after the following two
operations:
myList = [10,20,30,40]
i. myList.append([50,60])
ii. myList.extend([80,90])
4. What will be the output of the following code segment:2m
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])
5. Differentiate between Tuple and Dictionary.
6. d1={1:10,2:20,3:30,4:40,5:50,6:60,7:70}
d1.get (6)
d1 [6] =65
d1 [7] =35
print (d1)
d1.clear ()
print (d1)
7. What does each of the following expressions evaluate to? Suppose T is tuple containing:
(“These”,[“are”,”a”,”few”,”words”],”that”,”we”,”will”,
”use”)
a) T[1][0::2]
b) T[2][2] in T[1]
c) T[:1]+T[1]
d) T[2::2]
OR
State True or False:
a)In python ,a dictionary can have two same keys with different values.
b)The value of dictionary can be accessed with the help of indices.
Section – B
Each question carries 3 marks
8. Program to find mean of numeric values stored in a list.
OR
a) …………method is used to delete elements from a list if index is not known.
b) Tuples are………., you cannot update or edit the tuples.
c) Differentiate between remove() and pop()
9. Input a tuple of elements, search for min and max element in the tuple
10. Program of linear search on list of numbers.
Section C
Each question carries 4 marks
11. Start with the list[8,9,10]. Do the following using list functions
(a) Set the second entry to 17
(b) Add 4, 5 and 6 to the end of the list.
(c) Remove the first entry from the list.
(d) Double the list.
Display list at each step
12. Consider the following dictionary stateCapital:
stateCapital = {"AndhraPradesh":"Hyderabad","Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}
Find the output of the following statements:
i. print(stateCapital.get("Bihar"))
ii. print(stateCapital.keys())
iii. print(stateCapital.values())
iv. print(stateCapital.pop(“Bihar”))
v. print(len(stateCapital))
vi print("Maharashtra" in stateCapital)
vii. print(stateCapital.get("Assam"))
viii. del stateCapital["Rajasthan"]
print(stateCapital)
OR

What will be the output of the following code


segment:
a. myList = (1,2,3,4,5,6,7,8,9,10]
del myList[3::3]
print(myList)
b.myList = [1,2,3,4,5,6,7,8,9,10]
del myList[:5]
print(myList)
c. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[::2]
print(myList)
d)t = [1,2,3,4,5,6,7,8,9,10]
print (myList[::-2])
13. Define purpose of following functions considering l1 as list and d1 as dictionary:
a) l1.copy() b) l1.count()
b) d1.get() d) d1.clear()

ALL THE BEST

You might also like