The Man Behind the Bit Mask


The Man Behind the Bit Mask.

This the error I received.
Oops, try again. Your function fails on check_bit4(0b1000). It returns "'on" when it should return "on".
I'm not quite sure what is wrong, my code looks correct, and apprently it's returning what it is supposed to...

def check_bit4(input):
    desired=num & mask
    if input >= desired:
        return "'on"
        return "off"


Just kidding, I figured it out


Hi, @arcsolver34323 ,

Check, carefully, what is inside the double-quote marks, here ...

return "'on"

EDIT: Ah, you found it :slight_smile:


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