11.the man behind the mask exercise in bit wise operations in python
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.
I expected it to work .. I First get input then transfer it to integer then to a binary number and compared it with & operator to the mask .. why did it still considering input as a string ?????
mask = 0b1000 def check_bit4 (input): input = bin(int(input)) & mask if input > 0: return "on" else : return "off"