Grade 11 Computer Science HY - QP
Grade 11 Computer Science HY - QP
General Instructions:
• This question paper contains five sections, Section A to E.
• All questions are compulsory.
• Section A has 18 questions carrying 01 mark each.
• Section B has 07 Very Short Answer type questions carrying 02 marks each.
• Section C has 05 Short Answer type questions carrying 03 marks each.
• Section D has 03 Long Answer type questions carrying 05 marks each.
• Section E has 02 questions carrying 04 marks each.
• All programming questions are to be answered using Python Language only.
• Reading Time 15 minutes.
SECTION – A
1. Say True or False: 1
“Python variable required to be declared before storing the values.”
3. Which is the operator used to check if two variables refer to the same object in memory. 1
a) ‘==’ b) ’is’ c) ‘!=’ d) ‘in’
a) 21 b) 20 c) 22 d) Error
6. Which of the following will print the different output from others? 1
a) for I in range(3,6): b) for I in range(3,6,1): c) for I in [3,4,5]: d) for I in [3,4,5,6]:
print(I) print(I) print(I) print(I)
Page 1 of 6
7. Consider the value of n=5 and choose the correct output of the below code. 1
n=5
while n>0:
print(n,end=' ')
n=n-1
a) 5 4 3 2 1 b) 5 4 3 2 1 0 c) 1 2 3 4 5 d) Error
9. Which of the following function will returns a list containing all the words of the string? 1
a) find() b) partition() c) index() d) split()
10. Given the string S1=’Welcome’, which of the following statements will not give an error? 1
a) print(S1[4]) b) S2 = S1 c ) S1[3] = ‘e’ d) both (a) and (b)
12. Which of the following statements will remove element 3 from the list L=[1,2,3,4,5] 1
a) del L[2] b) L.remove(3) c) both (a) and (b) d) None of these
16. Predict the output of the following code if the input of the list S is: 1
L = [2,4,1,6,8,7,5]
n=len(L)
T=L[1:n-1]
print(L[0]==L[n-5] and L.index(6))
a) True b) False c) 0 d) 1
Page 2 of 6
Q17 and Q18 are ASSERTION and REASONING based questions. Mark the correct choice as
(a) Both A and R are True, and R is the correct explanation for A
(b) Both A and R are True, and R is not the correct explanation for A
(c) A is True and R is False
(d) A is False but R is True
17. Assertion (A): Dictionaries are mutable, but their keys are immutable. 1
Reason (R): The values of the dictionaries can be changed, but the keys of the dictionaries
cannot be changed because through them the data is hashed.
18. Assertion (A): Python built-in functions can be used without their module name. 1
Reason (R): Python functions in the modules should be imported before the use of it.
SECTION – B
19. Write the output of the following code. 2
x=10
y=2
while x>y:
print(x,y,sep='#')
x=x-1
y=y+2
20. What possible output(s) will be obtained when following code is executed? Write the 2
minimum and the maximum values of the variable N?
import random
SIDES =['EAST', 'WEST','NORTH','SOUTH']
N=random.randint(1,3)
OUT=" "
for I in range(N,0,-1):
OUT=OUT+SIDES[I]
print(OUT)
i. SOUTHNORTH
ii. SOUTHNORTHWEST
iii. SOUTH
iv. NORTHWEST
21. Rohan wrote the code to print the reverse of the given number. He made a few errors in the 2
code. Rewrite the code after correcting the errors in it.
num=int(input('Enter a number')
rev=0
rem=0
While num>0:
rem==num%10
rev=rev*10+rem
num=num/10
print('Reverse of the number = ', rev)
Page 3 of 6
23. Convert the below program into while loop and write the output of the program. 2
for i in range(-10,0,2):
print('Exam2023')
SECTION – C
26. Predict the output of the Python code given below. 3
S='term-2Exam2023'
NS=" "
c=0
for i in S:
if c%2!=0:
NS = NS + S[c]
else:
if i.islower():
NS = NS + i.upper()
else:
NS = NS + i
c=c+1
print('The new String is:',NS)
27. Write program to multiply the even position elements by 2 and divide the odd position 3
elements by 3 in the given list L.
For Example:
If L = [5, 23, 7, 14, 8, 9, 12]
Then the output should be:
L = [10, 7, 14, 4, 16, 3, 24]
28. Write a program to check whether the given number is a lead number or not? 3
Note 1: Do not convert the number to string.
Note 2: A lead number is the one whose sum of even digits are equal to the sum of odd digits.
For Example,
if the number is 3669, then the odd digits=3+9=12, and the even digits=6+6=12. Therefore
3669 is a lead number.
If the number is 3245, then the odd digits=3+5=8, and the even digits=2+4=6. The number
3245 is not a lead number.
Page 4 of 6
29. Write a program that, 3
• Reads a String from the user.
• Extracts all the digits from the string.
• If there are digits
➢ Sum the collected digits
➢ Print the original string and the sum of the digits in the string.
• If there are no digits
➢ Print the original string
➢ A message “Given string has no digits in it”
30. Write a program in Python that reads the 5 places and stores it in the dictionary PLACES and 3
displays the names (in uppercase) of the places whose names are longer than 5 characters.
For Example, consider the dictionary
PLACES={1:’Dubai’, 2:’Abudhabi’,3:’Sharjah’,4:’Ajman’,5:’Fujairah’}
The output should be:
ABUDHABI
SHARJAH
FUJAIRAH
SECTION – D
31. Write the output of the below statements:
import statistics, math
(a) print(statistics.mean([5,3,6,4,7])) 1
(b) print(statistics.median([5,4,6,3,7,5,4,8])) 1
(c) print(statistics.mode([5,4,6,5,2,3,4,4,5])) 1
1
(d) print(math.pow(2,3))
1
(e) print(math.floor(-8.25))
(or)
Page 5 of 6
33. Write a program to accept the price of the product and categorize the product based on the 5
price. Print the Category and Description as per the Criteria.
Criteria Category Description
Price < 10 and Price >=0 Budget This is an affordable product
Price >=10 and Price < 50 Mid-Range This is a mid-range product. You can but it.
Price >=50 and Price < 100 Premium This is a Premium Product. You can buy if you
want it.
Price >=100 Luxury This is a Luxury Product. Think before buy.
Negative Price values Invalid Input No Description for -ve inputs
SECTION – E
34. (a) What is the difference between a local variable and a global variable? Give a suitable 2
Python code to illustrate both.
(b) Write a program to read and store 5 different numbers in a tuple T and print the highest 2
number in the tuple T?
******************
Page 6 of 6