11/14 done completed code


#1

What is wrong here?

def check_bit4(input):
    newIn = input
    mask = 0b01000
    desired = newIn & mask
    if desired > 0:
        return "on"
    else:
        return "off"

found out what was wrong fixed code above


11/14 BItwise Operators
#2

Why are you shifting the input?


#4

def check_bit4(input):
if input > 0b111:
return "on"
else:
return "off"

try this code. this worked for me


#5
really works 
def check_bit4(input):
    check = 0b1000
    if input & check > 0:
        return "on"
    else:
        return "off"