What is the output of print(5 ^ 6) in Python?
print(5 ^ 6)
Correct answer
D. 3
5 views
D. 3
5 views
The ^ operator is bitwise XOR: 5 ^ 6 is 3.
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.