I keep getting the message:
"Oops, try again. Does your check_bit4 function take exactly one argument (an integer)? Your code threw a "unsupported operand type(s) for &: 'str' and 'int'" error. "
It should check to see if the fourth bit from the right of the input variable is on then return on if it is, or off if it is not.
How do I get rid of the error message and pass the test?
This is what I coded... def check_bit4(input): input = int(input) input = bin(input) mask = 0b1000 desired = input & mask if desired > 0: return "on" else: return "off"
What am I doing wrong?