यदि x=1 है तो निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
What will be the output of the following Python code snippet if x=1?
x<<2
A
8
B
1
C
2
D
4
Explanation
The << operator shifts the bits to the left. For x = 1, the binary representation of 1 is 0001. Shifting it left by 2 positions gives 0100, which equals 4.
Answer: (D) 4
Correct Answer: D) 4