Not seeing your question? It may still have been asked before – try () in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post ().
Other FAQs
The following are links to additional questions that our community has asked about this exercise:
This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by [contributing](https://discuss.codecadem y.com/t/how-to-contribute-to-t
FAQ: Learn Python - Introduction to Bitwise Operators - The Man Behind the Bit Maskhe-faq-guide/266984)!
Yes, I did the same. Instruction said the input would be an integer, so I coded it to translate that to binary.
Your code (and mine) doesn’t/didn’t work because the input is actually already in binary.
I wrote the same exact code as you @chiquitaleslita , and I couldn’t figure out why it was wrong to use bin(input) either.
After some research, I believe it’s wrong because bin() needs to take an integer as an argument otherwise it’ll throw an error. Therefore, if the editor ran something non-integer through it then it would throw that error. The “&” operator can take integer or bin, so it always works
I did the same. I created a variable which stores the binary value of the input but didn’t work.
How is the input being converted into binary for comparision?
With the comments of everyone and my own research I came to realize that to take an input from a user, which will be a string, it will be very difficult to convert that input to bits and perform operations on it.
Because, bin(int()) will return a string, so how do we perform operations on the result?
How do we make the returned string possible for us to perform bitwise operations on it?
The instructions request that those strings are returned from the value (it even asks you not to use print). It’d be marked as wrong just because those are two different things.