0

I'm trying to print the NOTed binary of a number using ~ e.g.

x = 0b11110000
c = ~x
print(bin(x))
print(bin(c))
print(bin(0b0001111))

I get

0b11110000
-0b11110001
0b1111

How do I get c to print as 0b1111 instead of its negative representation?

Vic C
  • 11
  • 1
  • 3

0 Answers0