I can't figure out what's wrong with this code. It gives me the error "Oops, try again. Your function fails on flip_bit('0b111', 2). It returns "None" when it should return "0b101"."
Using the little test code at the end that runs the function with the exact conditions that the error lists, I do get an output of 0b101. I'm not sure if the single quotes matter in this case and it's asking me to turn "number" from a string to a binary number or something, but I don't think that this is the case.
Replace this line with your code. def flip_bit(number, n): mask= 0b1<<(n-1) result=number^mask print bin(result) flip_bit(0b111,2)