11: The Man Behind The Bit Mask


My code keeps getting a error that says : Oops, try again. Your function fails on check_bit4(0b0). It returns "on" when it should return "off".

Can I get some help here? :confounded:

def check_bit4(input):
    mask = 0b1000
    desired = mask + input
    if desired > 0:
        return "on"
        return "off"
print check_bit4(0b1000)    
print check_bit4(0b1)


The above does not look like an XOR operation.


Im not sure what im supposed to change :frowning:


What operator should we use in an XOR expression?


OH!!! I got it ! Thank you!!!


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