Python Programming (2180711) MCQs

MCQs of Introduction to Python

Showing 61 to 70 out of 170 Questions
61.
Which of the following represents the bitwise XOR operator?
(a) &
(b) ^
(c) |
(d) !
Answer:

Option (b)

62.
What will be the output of the following Python expression? 0x35 | 0x75
(a) 115
(b) 116
(c) 117
(d) 118
Answer:

Option (c)

63.
It is not possible for the two’s complement value to be equal to the original value in any case.
(a) TRUE
(b) FALSE
Answer:

Option (b)

64.
The one’s complement of 110010101 is:
(a) 1101010
(b) 110010101
(c) 1101011
(d) 110010100
Answer:

Option (a)

65.
What will be the output of the following Python expression? 4^12
(a) 2
(b) 4
(c) 8
(d) 12
Answer:

Option (c)

66.
Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.
(a) 10
(b) 2
(c) 1
(d) 0
Answer:

Option (c)

67.
Which of the following expressions can be used to multiply a given number ‘a’ by 4?
(a) a<<2
(b) a<<4
(c) a>>2
(d) a>>4
Answer:

Option (a)

68.
What will be the output of the following Python code if a=10 and b =20? a=10 b=20 a=a^b b=a^b a=a^b print(a,b)
(a) 10 20
(b) 10 10
(c) 20 10
(d) 20 20
Answer:

Option (c)

69.
What will be the output of the following Python expression? ~100?
(a) 101
(b) -101
(c) 100
(d) -100
Answer:

Option (b)

70.
What will be the output of the following Python code snippet? bool(‘False’) bool()
(a) True True
(b) False True
(c) False False
(d) True False
Answer:

Option (d)

Showing 61 to 70 out of 170 Questions