Quando eu vou chamar esta função:
def check_bit4(input):
mask = "0b010"
desired = input & mask
if desired > 0:
return "on"
else:
return "off"
Aparece esse erro:
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'
Pesquisei, mas não achei uma solução para o erro
check_bit4
?