all.
I want to change 1 to 0 and 0 to 1 in binary.
for example,
if binary is 00000110. I want to change it to 11111001.
how to do that in python3?
Best regards.
all.
I want to change 1 to 0 and 0 to 1 in binary.
for example,
if binary is 00000110. I want to change it to 11111001.
how to do that in python3?
Best regards.
You can use the ~ operator. If A = 00100, ~A = 11011. If A is a string version of a decimal, convert it into int first.