Q.

What will be the output of the following
Python expression?
4^12

A. 2
B. 4
C. 8
D. 12
Answer» C. 8
Explanation: ^ is the xor operator. the binary form of 4 is 0100 and that of 12 is 1100. therefore, 0100^1100 is 1000, which is equal to 8.
2.1k
0
Do you find this helpful?
2

Discussion

No comments yet