Class 11 Computer Science Sample Paper Term 2 Set-2
Subject Code: 083
Class: 11
Max Marks – 35 /Time – 02 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. Write any two differences between lists and tuples.
2. if L = [1,2,3,4,5,6,7,8], What will be the output of following statement?
i) L[: :-2]
ii) L[3: :2]
3. What is a Dictionary? Can we define a list as a key of a dictionary?
4.Write equivalent python code of following expression :
5. Write the module /library import for following functions/methods:
i) mean( )
ii ) fabs( )
6. (i) What is the length of t1? t1= ((((1,2,3,4), “a”, “b”),”g”, 1, 3), “Sonu”)
ii) Find and write the output of the following python code:
a=(“Amit”, “Brinda”,”Ashish”,”Sumanta”)
print(a.index(“Brinda”))
7. Find and write the output of the following python code:
a=(1, 2, 3, 2, 3, 4, 5)
print(min(a) + max(a) + a.count(2))
or
t1 = (23, 45, 67, 43, 21, 41)
print(t1[-1:-5:-1])
Section -B
Each question carries 3 marks
8. Find and write the output of the following python code:
L =[“X”,20,”Y”,10,”Z”,30]
CNT = 0
ST = “”
INC = 0
for C in range(1,6,2):
CNT= CNT + C
ST= ST + L[C-1]+”@”
INC = INC + L[C]
print (CNT,INC,ST)
or
Moves=[11, 22, 33]
Queen=Moves
Moves[2]+=22
L=Len(Moves)
for i in range (L):
print “Now@”, Queen[L-i-1], “#”, Moves [i]
9. Write a Python Program to Input a tuple of elements, search for maximum element in the tuple and index of maximum element.
10. Find and write outputs of the following code:
Dc1={ }
Dc1[1]=1
Dc1[“1”]=2
Dc1[1.0]=4
Sum=0
for k in Dc1:
Sum+=Dc1[k]
print(Sum)
Section -C
Each question carries 4 marks
11. Write the python code to swap the list numbers in given manner:
e.g. [10,20,30,40,50]
Result: [50,40,30,20,10]
12. Find and write outputs of the following code. Also write the maximum and minimum value of pick.
import random
pick=random.randint(0,3)
city=[“Delhi”,”Mumbai”,”Chennai”,”Mumbai”]
for i in city:
for j in range(1,pick):
print(i,end=””)
print()
or
Find and write outputs of the following code. Also write the maximum and minimum value of the picker.
import random
picker=1+random.randint(0,2)
color=[“Blue”,”Pink”,”Green”,”Red”]
for i in range(1,picker+1):
for j in range(i+1):
print(color[j],end=””)
print()
13. Write a Python Program to Create a dictionary with the roll number, name and marks of n students in a class and display the names of students who have marks above 75.