Just Flip Out///Mask



point of may i know, my codes run seccessifully, but am not able to fugure out how one should come up with the mask, i tried to follow the example and was getting it wrong. see my codes. hoping you understand me

a = 0b11101110
mask = 0b11111111
x = a^mask
print bin(x) 

#below codes copied from the example to the (Just Flip Out)
a = 0b110 # 6
mask = 0b111 # 7
desired =  a ^ mask # 0b1

#below codes was my imagination for handling (Just Flip Out) exercise basing on the example(copies codes) above
a =  0b11101110   #238
mask =  0b11101111  #239
x = a ^ mask
print bin(x)

#thanks in advance


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.