Vidyalelo
Python · Q40

Python MCQs: Bitwise and Boolean Operations Chapter

Programming · Python · question 40

Q40

What is the result of ~5 ?

A.
5
B.
-5
Answer
C.
10
D.
-6

Answer: Option B

Solution

Answer: Option B
Solution:
The ~ operator performs bitwise NOT, inverting the bits of the number.