Doesn't Recognize binary string on code submit


#1

Here's my code for 18.13 Just Flip Out:

a = 0b11101110
mask = 0b00010001
desired = bin(a ^ mask)
print desired

Result:
0b11111111
None

But upon "Save and Submit Code" I get an error: "Oops, try again. Make sure your answer is a binary string."

This appears to be the same format as previous lessons but now I'm getting this error and I'm not sure why...


#2

Hi @coursejumper70218

Well, you did output a binary string, but you did not flip the bits. In the output, you should see a 1 wherever the value of a has a 0, and you should see a 0 wherever the value of a has a 1. The mask needs to be revised in order for this to happen.