You are viewing a single comment's thread. Return to all comments →
def flippingBits(n): # Write your code here x = bin(n)[2:].zfill(32) x = ''.join(['0' if i=='1' else '1' for i in x]) return (int(x,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 →
def flippingBits(n): # Write your code here x = bin(n)[2:].zfill(32) x = ''.join(['0' if i=='1' else '1' for i in x]) return (int(x,2))