You are viewing a single comment's thread. Return to all comments →
Python
def flippingBits(n): flippedBits = [] binaryNumber = bin(n)[2:].zfill(32) for bit in binaryNumber: flippedBits.append("1") if bit == "0" else flippedBits.append("0") return int("".join(flippedBits), base=2)
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping bits
You are viewing a single comment's thread. Return to all comments →
Python