0
When I call this function:
def check_bit4(input):
mask = "0b010"
desired = input & mask
if desired > 0:
return "on"
else:
return "off"
This error appears:
Traceback (most recent call last):
File "python", line 9, in <module>
File "python", line 3, in check_bit4
TypeError: unsupported operand type(s) for &: 'int' and 'str'
I searched, but I couldn’t find a solution to the error
The statement asks to verify the second least significant bit? What does 4 mean in the function name
check_bit4
?– Woss
Ask for the fourth bit, the wrong 1 position, I already switched
– lipesmile