Slip and Slide


#1



https://www.codecademy.com/courses/python-intermediate-en-KE1UJ/2/4?curriculum_id=4f89dab3d788890003000096#


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


#2

Read last line of instruction.

Return the result of calling bin(result)


#3

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.


#4

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