0% found this document useful (0 votes)
22 views5 pages

PT-2 Class-Xi-Cs

Uploaded by

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

PT-2 Class-Xi-Cs

Uploaded by

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

KENDRIYA VIDYALAYA SANGATHAN,GUWAHATI REGION

PM SHRI KENDRIYA VIDYALAYA NEW BONGAIGAON


PERIODIC TEST-II (2024-25)
SET:1 CLASS:11 SUBJECT: Computer Sc. TIME: 1:30 HOURS M.M.: 40
General Instructions:
1) All the questions are compulsory.
2) Reading Time: 08:15 to 8:30 AM
Writing Time: 08:30 to 10:00 AM
Section -A
Each question carries 2 marks
Q.No Part No Question Marks
Study the statement 1 & 2, select Correct option
kv=(‘Shift 1 & 2’, 226024, ‘Lucknow’)

Statement 1: kv is a valid Tuple


Statement 2: kv is mutable
1. a. (1)
a. Statement 1 is True and Statement 2 is True
b. Statement 1 is True and Statement 2 is False
c. Statement 2 is True
d. None of the statement is True
Write the output of the following:

a=(1, 2, 3, 2, 3, 4, 5)
print(min(a) + max(a) + a.count(2))
b. (1)
a. 13
b. 6
c. 8
d. Error
What will be the output of following code:

L=[12,13,14,15,16,17,18,19,20]
2. a. (1)
print (L[1: 6 : 3]
print (L[: : 3])

What will be the output of following code:


L=[12,13,14,15,16,17,18,19,20]
b. (1)
print(L.index(15))
print(L.pop())
What is the difference between append() and extend() function of
3. List in Python? Explain with example. (2)

4. a. What will be the output of following: (1)


L1=[5,7,9,6]
L2=[3,5,7,9]
print(L1+L2)
print(L1*2)
What will be the output of following:
b. (1)
L=[11,21,34,54,12,21,32,7]
print(L[7:0:-2])
Which of following statement will work for the tuple:
T=(1,2,3)

5. a. a. print(t+(1,)) (1)
b. print(t+(1))
c. print(t+1)
d. print(t+( ))
What will be the output of following:

b. L1=('a','b','c','d') (1)
L2=('A','B','C','D')
print(L1==L2)
What will be the output of following:

t1=(11,22,'abc','xyz')
a,b,c,d=t1
6. a=a+2 (2)
b=b+2
c=c*2
d=d*2
print(a,b,c,d)
Section – B
Each question carries 3 marks
What will be the output of following:
7. a. (1)
virus=dict(zip(('name','var','wave'), ('CORONA','delta',2)))
print(virus)
What will be the output of following:
teacher={'name':'MMM','desig':'PGT'}
b. (1)
newlist=teacher.items()
print(newlist)
c. What will be the output of the following list operations: (1)
m = [15,10,20]
m.extend([5,30])
print(m.index(5))
print(m.pop(3))
m.insert(3,25)
print(len(m))

Akshita has a list containing 10 integers. You need to help her to


create following programs to perform the operations based on
this list.
1. Traverse the content of the list and push the even
numbers into another list and print
new list.

2. Display the content of the main list in reverse order.

For Example:
If the sample Content of the list is as follows:
8. (3)
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]

Sample Output of the above code should be:


(1)[12,34,56,98,22,38]
(2)[38,35,22,98,79,21,56,34,13,12]

OR

Write a program to create a list and swap consecutive values of the


list and print it.

What will be the length of following tuple:


9. a. (1)
t=((('a',1),2),1)
What will be the output of following:
b. (1)
T= ('a', 'p', 'p', 'l', 'e')
print('p' not in T)
Fill in the blank.
c. (1)
The ………………… operator when used with a List/Tuple/String and
an integer, replicates the List/Tuple/String.
Write a program to print the sum of all values of a dictionary.

dict = {'a': 100, 'b':200, 'c':300, ‘d’:400, ‘e’:500}

10. (3)
OR

Write a program to create a dictionary and print keys and values


of the dictionary separately.
Section C
Each question carries 4 marks
Declare a dictionary of top 5 toppers of your class with their name
11. a. as keys and marks obtained as there value and print the details of (1)
student scored highest mark.
Find output of following code.

t2=("sun","mon","tue","wed","thru","fri")
b. (2)
for i in range (-6,0,2):
print(t2[i])

Given the lists L=[11,13,26,12,15,7,11,92] , write the output of


c. (1)
print(L[3:6])
Write a program in python to create a list and add & display twice
of odd values from the list of Numbers.
For example :
If the Nums contains [25,24,35,20,32,41]
The program should display
12. Twice of Odd Sum: 202 4

OR

Write a program in Python to create a list and count frequency of


each element of the list.
If the given tuple is,
T=(9,7,1,5,3,0,12,4,8)
13. a. (2)
Write a program in python to print largest element of the given
Tuple.
Rewrite the following programs after removing errors. Underline
all corrections done in the correct program.

L1=[11,12,13,14,15,14,12,11)
b. L2=[] (2)
for i in L1
IF i not in L2:
L2.append(i)
print.L2
14 What will be the output of the following Dictionary operations? (4)
d = {100:5,150:10,200:20}
print(d.pop(200))
d.update({100:30})
print(d.get(100))
d[300]=40
print(d.popitem())
print(max(d))
print(sorted(d))
OR
a.Write a python program that increases the values by 10 for all
keys of a dictionary that are even numbered. (2)
Eg: D={100:10, 133:20.400:40} Should result is D as {100:20,
133:20.400:50}

b. Write a python program to print the maximum, minimum and


sum of all the elements of a list of numbers. (3)

****************************************

You might also like