Just Flip Out///Mask


#1



https://www.codecademy.com/en/courses/python-intermediate-en-KE1UJ/2/3?curriculum_id=4f89dab3d788890003000096


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


#2

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