Class 11 Python Mcq

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

MOST IMPORTANT MULTIPLE CHOICE QUESTIONS

INFORMATICS PRACTICS
CLASS – XI TERM -I SESSION 2021-2022
200+ MCQ - PYTHON REVISON

Q1 Single Line comments in Python begin with …… symbol.

a) #
b) %
c) ;
d) “

Q2 Which of the following operator is floor division ?


a) <
b) //
c) /
d) +

Q3 Which of the following is an invalid statement ?


a) I=J=K=50
b) I,J,K=50,60,70
c) I J K =50 60 70
d) I_J_K=70

Q4 An ordered set of instructions or commands to be executed by a computer called

a) Line b) command c) program d) none of the above


Q5 Which of the following functions print the output to the console ?
a) Output( ) b) Print ( ) c) Echo( ) d) print ( )
Q6 Select the reserved words in Python .
a) if b) input c) import d) all of these
Q7 What will be the output of the following code ?
x,y=2,6
x,y=y,x+2
print(x,y)
a) 6 6 b)44 c)46 d)6 4

Q8 Choose the perfect word for Python , Python is a …. Language


a) Upper case b ) Lower case c) Case sensitive d ) None

Q9 The reserved words used by Python interpreter to recognize the structure of a


program are termed as
a) Keywords b ) Identifiers c) Token d) Literals

Q 10 Operators that act upon two operands are referred as …..


a) Unary operator b) Binary operator c) Assignment operator d) None

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

Q 12 The conversion of one data type to another data type is known as ….


a) Debugging b) Function c)Type casting d ) All of these

Q 13 What will be the output of the following expression


12 * ( 13%4 ) // 2 + 6
a) 55 b) 24 c ) 22 d) 12

Q 14 Choose the example of Mutable Objects


a) int b) complex c) bool d) list
Q 15 Nikita has written program but she is not getting the desired result .Why ?
a=input(“enter a number”)
b=input(“enter 2nd Number”)
c=a+b
print(c)
a) wrong coding b) type casting problem
c) formula of sum is incorrect d) none of the above
Q 16 Choose the correct identifier name
a) 9marks b)&sum c ) _Total d) All are correct
Q 17 The given program has an error , find out the correct option with line number.
10=a #Line 1
b=45 #Line 2
a+b=c #Line 3
print( c ) #Line 4
Error in line number …
a) 1 b) 2 c) 3 d) 1 & 3
Q 18 p=20
print(id(p))
These statements will give
a) Address of p b ) value of p c) address & value both d) none
Q 19 The Escape sequence \n is used for …
a) New line b) new word c) new Character d ) All of these
Q 20 type ( ) function is used to find out the ….
a) To declare a function
b) To define a function
c) To know the type of variable
d) None
Q 21 > is the example of ……. Operator
a) Arithmetic b) relation c) logical d) assignment
Q 22 What will be the output of the following code
print( ‘H’ in ‘Hello’)
a) Hello b ) ello c) true d ) None
Q 23 Slicing is used to retrieve a …… of values .
a) Subset b) 2 values c) big d) All of these
Q 24 In Python automatic data conversion is known as …. Type conversion
a) Explicit b ) implicit c) mix d) None
Q 25 In Python a function is defined by keyword.

a) Definition b) Def c) user d ) def


Q 26 An identifier must be a keyword of Python
a) True b ) False
Q 27 What will be the output of the following code
p=10
q=20
p*=q/3
q+=p+q*2
print(p,q)
a) 66.666 126.66
b) 78.66 162.66
c) 126.66 66.66
d) 89.22 156.99
Q 28 Rohan is making program in python when he is taking whole number , result of
program is correct but when he is taking decimal values , he is not getting result
according to decimal values . He is getting result on basis of whole numbers ,
what he should do to get the accuracy in result .
a) Re - write the program
b) Give comment in program
c) Change int data type in to float
d) Refresh the program
Q 29 In python a variable can hold values of different types at different times. It is
known as …….
a) Multi tasking
b) Multi capacity
c) Dynamic typing
d) Attribute of comment
Q 30 To remove the errors from the program is …..
a) Bug b) debug c) semantics d) None
Q 31 Shalini is writing the following code ,
p
q
print(p,q)

She is getting an error why?


a) Values are not assigned to p & q
b) P & q are written in separate lines
c) P & q are not made comments
d) None
Q 32 What is the maximum possible length of an identifier?
a) 31 characters b) 63 characters
b) 79 characters d) none of the mentioned

Q 33 Who developed the Python language?


a) Zim Den b) Wick van Rossum
b) Guido van Rossum c)NieneStom

Q 34 What do we use to define a block of code in Python language?


a) Key
b) Brackets
c) Indentation
d) None of these
Q 35 How many keywords present in the python programming language?
a) 32
b) 61
c) 33
d) 27
Q 36 In which language is Python written?

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?

a. Parentheses, Exponential, Multiplication, Division, Addition,


Subtraction
b. Multiplication, Division, Addition, Subtraction, Parentheses,
Exponential
c. Division, Multiplication, Addition, Subtraction, Parentheses,
Exponential
d. Exponential, Parentheses, Multiplication, Division, Addition,
Subtraction
Q 39 What is the answer to this expression, 22 % 3 is?
a) 7
b) 1
c) 0
d) 5
Q 40 What error occurs when you execute the following Python code snippet?
apple = mango
a)SyntaxError
b)NameError
c)ValueError
d) TypeError

41 Which of the following is a selection control statement:-


a. for b. while c. if..else.. d. print
42 Which of the following is a loop control statement:-
a. for b. do..while c. if..else.. d. print
43 Which of the following is not a valid loop control statement in Python:-
a. for b. while c. if..else.. d. do..while..
44 In statement: for var in : , the blank can be filled with
(choose two options)
a. Single Value b. An iterable sequence c. an expression. d. range()
45 In statement: for var in range(3) : , the range(3) is equivalent to:
(choose two options)
a. range(1,3) b. range(0,3) c. range(1,3,0) d. range(0,3,1)
46 In statement: for var in range(4) : , the range(4) will yield an iterable
sequence like :
a. [0,2,4] b. [1,2,3,4] c. [0,1,2,3] d. [0,1,2,3,4]
47 Which of the following statements will not executes
successfully? a. if (1,2): b. if (1,2)
print(“foo”) print(“foo”)

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

61 What will be printed if the user enters -2 for a


a. North b. South c. North East d. South West

62 What will be printed if the user enters 5 for a


a. North b. South c. West. East d. South West

63 What will be printed if the user enters 4 for a ..] (H.W)


a. North b. South c. West. East e. 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, 33, 222, 14] b. Error


c. 25 d. [25, 14, 222, 33, 2]
73. Suppose list1 is [1,3,2], What is list1 * 2? 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

86. Write the output of the following:


T=[1,2,3,4]
T1=[3,4,5,6]
T2=T.append(T1)
print(T2)

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

⮚ JOIN TELEGRAM GROUP FOR DOUBT CLEARANCE..

https://t.me/Ipcsbyyogendra

🞂 SUBSCRIBE IPCSBYYOGENDRASIR CHANNEL ON YOUTUBE


http://Www.youtube.com/Ipcsbyyogendrasir

You might also like