I am doing some calculations and I was wondering how you can invert a byte in python.
For example:
0b11111111
should be flipped to 0b00000000
.
I have tried turning into a string and flipping it then but I cant somehow turn it back into a Integer.
Also, I want to add that the ~ does not work, as it simply just makes the same number but negative