निम्नलिखित अभिव्यक्ति का आउटपुट क्या होगा?
What will be the output of the following expression ?
x = 4
print(x<<2)
A)
B)
C)
D)
Explanation:
Sure!
The <<
operator shifts the bits to the left.
For x = 4
(binary 100
), x << 2
shifts the bits two places left, giving 10000
, which is 16
.
Answer: (B) 16.