Grade 11 IP Final Exam
Grade 11 IP Final Exam
General Instructions:
SECTION A
1. What will be the output of the following Python code snippet? 1
x=2
for i in range(x):
x += 1
print (x)
a. ['d', 'c', 'b'] b. ['a', 'c', 'e'] c. ['a', 'b', 'd'] d. ['e', 'c', 'a']
6. Suppose a list L= [3, 4, 5, 20, 5, 25, 1, 3], then what is the result of L.remove(4)? 1
a. [55, 25, 24, 20, 15, 13, 11, 3] b. [13,24,55, 20,1 5, 25, 11, 3]
c. [3, 11, 13, 15, 20, 24, 25, 55] d.[3, 11, 25, 15, 20, 55,24,13]
8. list1 = [10,20,30,70,80] 1
list2 = [30,40,50]
list1.extend(list2)
print(list1) #The result is
a. [10, 20, 30, 70, 80, 40, 50] b.[ [10, 20, 30, 70, 80],[ 30, 40, 50]]
c. [10, 20, 30, 70, 80, 30, 40, 50] d. [30, 40, 50,10,20,30,70,8]
9. What is the output of the following code snippet? 1
x = 'abcd'
for i in x:
print(i)
a. a b c d b. 0 1 2 3 c.i i i i d. x x x x
10 Consider a dictionary 1
dict3 = {'Mohan':95,'Ram':89,'Suhel':92,'Sam':85}
print(dict3['Ram']) #The result is
a. {'A': 95, 'B': 78,'C': 89, 'D': 92, 'E': 85} b. {'A': 95, 'C': 89, 'D': 92, 'E': 85, 'B': 78}
c. {'B': 78,'A': 95, 'C': 89, 'D': 92, 'E': 85} d. {'A': 95, 'C': 89, 'D': 92, 'E': 85},{'B': 78}
12. dict1 = {'A':'A','E':'E','D':'D','C':'C','B':'B'} 1
del dict1['D']
print(dict1)
a. ['A': 'A', 'E': 'E', 'C': 'C', 'B': 'B'] b. {'A': 'A', 'B': 'B', 'C': 'C', 'E': 'E'}
c. {‘D': 'D'} d. {'A': 'A', 'E': 'E', 'C': 'C', 'B': 'B'}
13. dict1 = {'A':95,'C':89,'D':92,'E':85} 1
print( len(dict1))
a. / b. // c. % d. **
15. Which of the following is not a Python IDE? 1
He asked his student to write code to delete last element of list L1. Help them to write the correct code.
21. Continue to the previous question 20, Sir wanted to add a new number 66 before 19 in list L1. 2
He asked Raheem to identify the position of 19 and insert that. What code Raheem should tell him?
22. For the given dictionary 2
d1 = {‘a’:10,’b’:20, ‘c’:30,’d’:40}
Which of the following code will display value 30?
23. Predict the Output: 2
dict1 = {"name": "Mike", "salary": 8000}
temp = dict1.pop("age")
print(temp)
24. What will be the output of following program: 2
test = {1:'A', 2:'B', 3:'C'}
del test[1]
test[1] = 'D'
del test[2]
print(len(test))
25. What will be the output of following program: 2
A = [2, 4, 6, 8,10]
L = len (A)
S=0
for I in range (1, L, 2):
S+=A[I]
print("Sum=",S)
SECTION C
26. Write a Python program to get the largest number from a list. 3
27. Write a program to print the following pattern (using only one * in a print statement) 3
*
**
***
28. How are dictionaries different from lists? 3
29. What are the characteristics of Python Dictionaries ? 3
30. Write the output of the given python code : 3
aList = [123, ‘xyz’, ‘zara’, ‘abc’];
aList.pop()
aList.pop(2)
print(aList)
SECTION D
31. Which of the following identifier names are invalid and why? 5
(a) Serial_no. (b) 1st_Room (c) Hundred$ (d) Total Marks (e) total-Marks
32. Give the output of the following when num1 = 4, num2 = 3, num3 = 2 5
(a) num1 += num2 + num3 (b) num1 = num1 ** (num2 + num3)
(c) num1 *= num2 + c (d) num1 = ‘5’ + ‘5’ (e) num1=float(10)
33. What are the different ways to create a dictionary? Elaborate your answer with an example. 5
Page 3 of 4
SECTION E
34. Write a Python program to sum all the items in a list. 4
35. Write a program to find out the grade of student based on his obtained percent as per following 4
conditions:
Percent Grade
<49 F
50 to 69 C
70 to 89 B
90 and above A
***
Page 4 of 4