Slip and Slide


Oops, try again. Your function crashed on (7, 2) as input because your function throws a "bin() takes no arguments (1 given)" error.

I am so confused. I keep reading previous forums, but I'm still confused.

Replace this line with your code. 
def flip_bit(number, n):
    mask = 0b1<<(n-1)
    result = mask ^ number
    print result


Read last line of instruction.

Return the result of calling bin(result)


Thank you! I see what I was doing wrong. When was putting bin() it wasn't working, which was because I wasn't returning it I was printing it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.