What is the output of the following expression ?
>>> ~1001
-999
1001
-1002
-1000
If we have an expression ~X. This is evaluated as: -X – 1.
So -1001 will be evaluated to -1001-1 which is -1002
Comment here: