How can I write the binary equivalent of a number?


#1

Question

How can I write the binary equivalent of a number?

Answer

To write any number in binary, add the necessary powers of 2 until you’ve got your number. This is easy enough for small numbers, but not feasible for larger ones. For a better method, check out this video tutorial on converting decimal to binary!


FAQ: Learn Python - Introduction to Bitwise Operators - I Can Count to 1100!