Class 11 Python Mcq
Class 11 Python Mcq
Class 11 Python Mcq
INFORMATICS PRACTICS
CLASS – XI TERM -I SESSION 2021-2022
200+ MCQ - PYTHON REVISON
a) #
b) %
c) ;
d) “
Q 11 The Error that occurs during the execution of the program is known as ….
a) Syntax Error b ) Semantics Error c ) Run time error d) None
a. English
b. PHP
c. C
d. All of the above
Q 37 Which of the following operators is the correct option for power(ab)?
a. a. a ^ b
b. a**b
c. a ^ ^ b
d. a ^ * b
Q 38 Which of the following precedence order is correct in Python?
c. if (2): d. if (1) :
print(“foo”) print(“foo”)
48 In an if..else… statement the portion is optional.
a. colon (:) b. Expression c. else d. if
49 In a for statement the portion is optional.
a. colon (:) b. Expression c. else d. for
50 How many times following loop will execute:
for x in range(-5):
print(x)
a. 5 b. 0 c. infinite d. Error
51 How many times following loop will execute:
for x in range(3):
Print(x)
a. 3 b. 0 c. infinite d. 2
52 How many times following loop will execute:
for x in ‘Computer’:
print(x)
a. 10 b. 1 c. 8 d. 0
53 How many times following loop will execute:
for x in [1,3,5,7,9,11]:
print(x)
a. 3 b. 5 c. 7 d. 6
Consider the following code segment for the questions 54 to
59
a=int(input(‘Enter an integer’)
b=int(input(‘Enter an integer’)
if a<=0:
b=b+1
else:
a=a+1
if a >0 and b>0:
print(‘W’)
elif a>0:
print(‘X’)
if b>0:
print(‘Y’)
else:
print(‘Z’)
54 What letters will be printed if the user enters 0 for a and 0 for b?
a. Only W b. Only X c. only Y d. W and Y e. W,X and Y
55 What letters will be printed if the user enters 1 for a and 1 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y
56 What letters will be printed if the user enters 1 for a and -1 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y
57 What letters will be printed if the user enters 1 for a and 0 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y
58 What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W b. Only X c. only Y d. W and Y e. only Z
59 What letters will be printed if the user enters 2 for a and 2 for b?
a. Only W b. Only X c. only Y d. W and Y e. W,X and Y
60 Consider the following code and answer the questions
to
x=int(input(‘Enter an integer’))
63
if x <= 0 :
print(‘North’)
elf if x >2 :
print(‘South’)
if x = = 5 :
print(‘West’)
else :
print(‘East’)
60 What will be printed if the user enters 2 for a
a. North b. South c. East d. South West
64 “Else portion of for loop statement is optional and executes after completion of
for loop.”
a. True b. False
65 Which will be the correct if statement for expression : “Place is either Delhi or
Goa but not Jaipur”
a. if place= = “Delhi” and place= = “Goa” and place != “Jaipur” :
b. if place= = “Delhi” or place= = “Goa” and place != “Jaipur” :
c. if place= = “Delhi” and place= = “Goa” or place != “Jaipur” :
d. if (place= = “Delhi” or place= = “Goa” ) and place != “Jaipur” :
66 What will be the output of following code:
for x in range(3):
pass
else:
print(x)
a. 4 b. 3 c. 1 d. 2
Consider the following code and answer the Question 67 to 69
X=int(input(“Enter integer”))
Y=int(input(“Enter integer”))
Z=int(input(“Enter integer”))
for K in range (X, Y, Z):
print(K, end= “ ,”)
67 What will be printed if the user enters 2 for X , 10 for Y and 2 for Z
a. 2, 4, 6, 8,10 b. 10,8,6,4
c. 2, 4, 6, 8 d. 10, 8, 6, 4, 2
68 What will be printed if the user enters 10 for X , 2 for Y and -2 for Z
a. 2, 4, 6, 8,10 b. 10,8,6,4
c. 2, 4, 6, 8 d. 10, 8, 6, 4, 2
69 What will be printed if the user enters 10 for X , 2 for Y and 4 for Z
a. 2, 4, 6, 8,10 b. Nothing will come on screen
c. Infinite loop d. 10, 8, 6, 4, 2
70 How many times “Hello” will print on screen after execution of given code:
for x in range(3):
for y in range(x):
print(“Hello”)
a. 2 times b. 4 times
c. 3 times d. 6 times
71. Suppose list1 is [2, 33, 222, 14, 25], What is list[-1]? 1
a. Error b. None
c. 25 d. 2
72. Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]? 1
a. [2,6,4] b. [1,3,2,1,3]
c. [1,3,2,1,3,2] d. [1,3,2,3,2,1]
74. If list1=[11,2,23] and list2=[11,2,2], What will be the output of 1
print(list1 < list2)?
a. True b. False
c. Error d. None
75. To add a new element to a list, we use which command? 1
a. list1.add(5) b. list1.append(5)
c. list1.addLast(5) d. list1.addEnd(5)
76. To remove string “hello” from list1, we use which command? 1
a. list1.remove(“hello”) b. list1.remove(hello)
c. list1.removeAll(“hello”) d. list1.removeOne(“hello”)
77. Suppose list1 is [3,4,5,20,5], What is list1.index(5)? 1
a. 0 b. 1
c. 4 d. 2
78. What will be the output of the following 1
code?
list1=[1,3]
list2=list1
list1[0]=4
print(list2)
a. [1,3] b. [4,3]
c. [1,4] d. [1,3,4]
79. What will be the output of the following code? 1
list1=[8,0,9,5]
print(list1[::-1])
a. [5,9,0,8] b. [8,0,9]
c. [8,0,9,5] d. [0,9,5]
80. Which of the following will give output as [23,2,9,75] if 1
list1=[6,23,3,2,0,9,8,75]?
a. print(list1[1:7:2]) b. print(list1[0:7:2])
c. print(list1[1:8:2]) d. print(list1[0:8:2])
81. What will be the output of the following python code? 1
list1=[“Python”, “Java”, “c”, “C”, “C++”]
print(min(list1))
a. c b. C++
c. C d. min function cannot be used for string
82. What will be the result after execution of below python code? 1
list1=[3,2,5,7,3,6]
list1.pop(3)
print(list1)
a. [3,2,5,3,6] b. [2,5,7,3,6]
c. [2,5,7,6] d. [3,2,5,7,3,6]
83. Write the output of the following code: 1
list(“welcome”)
a. [‘w’,’e’,’l’,’c’,’o’,’m’,’e’] b. (‘w’,’e’,’l’,’c’,’o’,’m’,’e’)
c. [‘welcome’] d. None of the above
84. Write the output of the following code:
L=[0.5*x for x in range(4)] (0,1,2,3)
print(L)
a. [0.0,0.5,1.0,1.5] b. (0.5,1.5)
c. [0.0,0.5,1.0,1.5,2.0] d. Error
85. Write the output of the following code:
L=[1,2,3,4,5]
for i in L:
print(i,end=“ ”)
a. 1 2 3 4 5 b. 1 3 5
c. Error d. None of the above
a. [1,2,3,4,[3,4,5,6]] b. [1,2,3,4,3,4,5,6]
c. None d. None of the above
87. What is the output of the following?
L=[[‘Physics’,101],[‘Chemistry’,202],[‘Maths’,303],45,6,’j’]
print(len(L))
a. 3 b. 4
c. 5 d. 6
88. What is the output of the following code:
list1=[3,2,5,7,3,6]
list1.insert(6,3
) print(list1)
a. [3,2,5,6,7,3,6] b. [3,2,5,6,3,6]
c. [3,2,5,7,3,6,3] d. None of these
89. Which of the following command will create a list?
a. list1=list() b. list1=[ ]
c. list1=list([1,2,3]) d. All of these
.
90 What is the output when the following code is executed?
names=[‘Amir’,’Bear’,’Charlton’,’Daman’]
print(names[-1][-1])
a. A b. Daman
c. Error d. n
91. What is the output of the following code?
‘welcome to python’.split()
a. [‘welcome’,’to’,’python’] b. (‘welcome’,’to’,’python’)
c. {‘welcome’,’to’,’python’} d. ‘welcome’,’to’,’python’
92. What will the output of the following
code?
list1=[1,2,3,4]
list2=[5,6,7,8]
print(len(list1+list2))
a. 2 b. 4
c. 5 d. 8
93. Select the output of the following expression:
str1=’pen’
print(list(str1))
a. [‘p’,’e’,’n’] b. [pen]
c. [p/e/n] d. {‘pen’}
94. What is the correct way to get minimum value from a list in python?
a. print(minimum(mylist)) b. print(min(mylist))
c. print(mylist.min()) d. print(mylist.minimum())
95. Suppose list1 is [3,4,5,20,5,25,1,3], What is list1.count(5)?
a. 0 b. 4
c. 1 d. 2
96. Which command is used to insert 6 in a list “L” at 3rd position?
a. L.insert(2,6) b. L.insert(3,6)
c. L.add(3,6) d. L.append(2,6)
97. What will be the output of the following python code?
names1=[‘Amir’,’Bala’,’Charles’]
if ‘amir’ in names1:
print(1)
else:
print(2)
a. None b. 1
c. 2 d. Error
98. What will be the output of the following python code?
names1=[‘Amir’,’Bala’,’Charlie’]
names2=[name.lower() for name in names1]
print(names2[2][0])
a. None b. a
c. b d. c
99 What will be the output of the following python code?
matrix=[[1,2,3,4],[4,5,6,7],[8,9,10,11], [12,13,14,15]]
for i in range(0,4):
print(matrix[i][1],end=’ ‘)
a. 1 2 3 4 b. 4 5 6 7
c. 1 3 8 12 d. 2 5 9 13
100 What will be the output of the following code?
. a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)
a. [13,56,17,[87],45,67] b. [13,56,17,87,45,67]
c. [13,56,17,87,[45,67]] d. [13,56,17,[87],[45,67]]
⮚ JOIN TELEGRAM CHANNEL FOR PDF NOTES
https://t.me/ipcsbyyogendrasir
https://t.me/Ipcsbyyogendra