Grade 11 Sample Paper C SC MODEL PAPER
Grade 11 Sample Paper C SC MODEL PAPER
COMPUTER SCIENCE
General instructions:
• The question paper contains 35 questions.
• The paper is divided into 4 Sections- A, B, C, D and E.
• Section A consists of 18 questions (1 to 18). Each question carries 1 Mark.
• Section B consists of 7 questions (19 to 25). Each question carries 2 Marks.
• Section C consists of 5 questions (26 to 30). Each question carries 3 Marks.
• Section D consists of 2 questions (31 to 32). Each question carries 4 Marks.
• Section E consists of 3 questions (33 to 35). Each question carries 5 Marks.
• All programming questions are to be answered using Python Language only.
SECTION A [18*1=18]
1 What is printed when the following code is executed? [1]
tup = ('30', '3', '2', '8')
print(sorted(tup, reverse = True))
a) ['2', '3', '30', '8'] b)['8', '30', '3', '2'] c) ['30', '8', '3', '2'] d) Error
5 Which of the following is true about the List data type in Python? [1]
a) 54 b) 93 c) 94 d) Error
12 A ______________ statement skips the rest of the loop and jumps over to the statement [1]
following the loop.
a) Break b) continue c) if else d) pass
13 What does the following code print? [1]
output = ""
x = -5
while x < 0:
x=x+1
output = output + str(x) + " "
print(output)
a) 5 4 3 2 1 b) -4 -3 -2 -1 0 c) -5 -4 -3 -2 -1 d) 4 3 2 1
14 Which of the following is not a valid for loop in Python? [1]
SECTION B [2*7=14]
19 Rewrite the code after correcting the errors. Underline the corrected code.
[2]
l=[10,20,30,40]
for i in range(len(l))
if (i%2=0):
print(l(i),end="#")
Else:
print(l[i])
20 Write a program to print the following pattern using nested for loop. [2]
P
PY
PYT
PYTH
PYTHO
PYTHON
21 Find the output: [2]
str1=list("Oob@sch*")
for i in range(0,len(str1)):
if i==5:
str1[i]=str1[i]*2
elif str1[i].isupper( ):
str1[i]=str1[i]*3
else:
str1[i]="A"
print(str1)
22 Specify two methods to delete the key-value pair for key="cow" in the dictionary. [2]
d={"lion":"wild","tiger":"wild","cat":"domestic","cow":"domestic"}
23 Write a program that takes a value and checks whether it is part of the given dictionary or not. [2]
If yes, the program should print the corresponding key, otherwise print an error message.
24 Write a program that reads a string and changes the case of uppercase to lowercase and vice [2]
versa, space to # and digits to $.
25 Consider the following Dictionary [2]
Evaluate each statement starting with the same value of the dictionary D and write the output
a) D[“How”]=D[“was”]+100
b) D.setdefault(“was”,200)
c) D.pop()
SECTION C [3*5=15]
26 Write a program that reads a string and a substring. [3]
a) It should display the number of occurrences of the given substring in the string.
b) Display the string in reverse order- one character per line
27 a) Evaluate the following expression: [3]
48 % 3 ** 3//5 +2**6
SECTION D [2*4=8]
31 Consider the given list:
L=[“apple”, ”orange”, ”pear”, ”strawberry”, “pineapple”] [2]
a) remove all strings starting with the letter p and display the new list.
[2]
b) display the names which has more than 5 letters in it.
32 Use the code given below to answer the questions based on it: [4]
inp1str=input(“enter string of digit:”)
inp2str=input(“enter string of digits”)
if len(inp1str)>len(inp2str):
small=inp2str
large=inp1str
else:
small=inp1str
large=inp2str
newStr=” ”
for element in small :
result=int(element)+int(large[0])
newStr=newStr + str(result)
large=large[1:]
print(len(newStr)) --------line 1
print(newStr) ---------line 2
print(large) ---------line 3
print(small) --------line 4
a) Given a first input of 12345 and a second input of 246, what result is produced by line 1?
b) Given a first input of 12345 and a second input of 246, what result is produced by line 2?
c) Given a first input of 123 and a second input of 4567, what result is produced by line 3?
d) Given a first input of 123 and a second input of 4567, what result is produced by line 4?
SECTION E [3*5=15]
33 Create two lists of n numbers. [5]
a) Accept user inputs to create the lists.
b) Find the sum of the even-indexed elements of list 1 with the odd-indexed elements of list 2.
c) Display the common elements in both lists.
d) If the new list is L, what change does the code L[::2]=10,20,30 make in list L?
34 Write a menu-driven program to create a tuple and perform the following [5]
a) Accept 10 user input to create a tuple
b) Receive the index and return the corresponding value.
c) Display the even numbers and odd numbers in separate tuples