Bit of this AND that .... Coecademy error


print int(bin(x),2)

Output window give 4 which is correct But Codecademy throws this:
Oops, try again. It looks like the value you printed isn't correct.

Surely I am missing something very obvious. Thanks in advance for any help.


You're changing the binary to an integer before printing it. It's looking for binary.

print bin(0b1110 & 0b101)


Many thanks for your help.


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