My code for “The Man behind the bit mask” was giving me an error,
it was something like: unsupported for & operand: ‘str’ & ‘int’.
This was my faulty code
mask = 0b1000
and_compare = bin(input) & mask
if and_compare > 0:
I didn’t need to convert the “input” (an integer) into binary with the bin function.
When using bit operators are integers converted to binary?
How does python compare an integer argument with a binary number?