What is the output of print(1 << 3) in Python?
print(1
Correct answer
D. 8
D. 8
The << operator shifts bits left; 1 << 3 is 8.
Asked in: Python Interview Basics
https://docs.python.org/3/tutorial/introduction.htmlNot sure why the answer is D? Ask here and get an explanation.