Python
Unit 2 MCQ Questions
1.Which is the correct operator for power (xy)?
a) x^y
b) x**y
c) x^^y
d) None of these
2.What is the answer of the expression 22%3?
a) 7
b) 1
c) 0
d) 5
3.What is the output of following expression 3*1 **3?
a) 27
b) 9
c) 3
d) 1
4.The expression ‘int(x)’ implies that the variable x is converted to an integer.
a) True
b) False
5.The range () function by default returns a ______ .
a) Tuple
b) Strin
c) List
d) dict
6.Select conditional statements that are available in python . (select any three
from below).
a) if
else if
b) elif
c) if elif
d) if else
7.Is ‘for’ loop possible without range () in python?
a) Yes
b) No
c) Maybe
8.Which statement will check if a is equal to b?
a) if a==b:
b) if a==b:
c) if a===c:
d) if a=b
9.How many times will the loop run?
i=2
while (i>0):
i=i-1
a) 2 times
b) 3 times
c) 1 times
d) 0 times
10.What are the loop manipulation keywords ? (select any two)
a) Continue
b) Break
c) Range
d) Int
11.Conditional statements are also called as _____.
a) Iterative
b) Repetitive
c) Decision making
d) Universal
12.Which operator results true if specified left operand element is present in
specified right operand sequence?
a) Is
b) Not in
c) In
d) Is not
13.What is ‘ range () ’?
a) Method
b) Class
c) Variable
d) Function
e) All of the above
14.Which of the following is corect?
a) Arithmetic operators are used for mathematical operations.
b) Mathematical operations can be performed on string also.
c) Both a and b
d) None of these
15.What is the name of ‘+=’ operator?
a) Exponent AND
b) Add AND
c) Increment operator
d) Modulus AND
16.operator precedence of exponentition (‘**’) is higher than complement (‘
‘)?
a) True
b) False
17.loop control statements are______.
a) Iterative
b) Decision making
c) Non iterative
d) Not changeable
18.What is the name of ‘ >= ’ operator?
a) Less than or equal to
b) Equals to or less than
c) Greater than or equal to
d) Greater than
19.While loop can be used for printing ‘ hello ‘ message 17 times without
incrementing value of loop counter.
a) True
b) False
20. for loop can be used to find odd numbers between 0 to 100.
a) True
b) False
21. What will be output of following code
a=10
b=11
if a>b
print (“a is greater”)
else
print(“b is greater”)
a) A is greater
b) B is greater
c) Error
d) 10
22.Which of the following is comparison operator?
a) :=
b) >>
c) <<
d) =
23.We can’t write if- else statement in single line, in python.
a) True
b) False
24.”==” operator is used for .
a) Intilalize a value to a variable
b) Checking left hand side value is equal to rhs value
c) Both a&b
d) None of the above
25.’ a|b ’ is called as .
a) Logical OR
b) Bitwise AND
c) Bitwise OR
d) Logical AND