Code is not returning on when bit 0b1000 is on.
I'm not sure why it's not returning on
def check_bit4(input): mask = 0b1000 desired = input | mask if desired > 0b111: return "on" else: return "off"
I figured that I would check between a number with the bit on, and a number for the input. If either number has bit 0b1000 on, then shouldn't it be greater then 0b111?