Binary Planet |2| ~~~~~~~~~~~~~~~~~ Marul is our friend who has come from another planet. In their planet, decimal representations of numbers are not common. Instead, they use binary representations. Write a program to help Marul, which takes an *integer* and prints 8-bit binary representation of that integer as a *string*. .. container:: sampleio Sample I/O: .. |2| image:: ../../figures/difficulty_three.png :class: difficulty .. code:: default Input: 11 Output: 00001011 Input: 129 Output: 10000001 Input: 255 Output: 11111111 .. raw:: html .. raw:: html
.. code:: python n = int(input()) s = "" for i in range(7,-1,-1): if n >= 2**i: s+="1" n-=2**i else: s+="0" print(s) .. raw:: html