Algorithmic problemElementary20 XPExercise 9/9
To binary
Task
The program reads a non-negative whole number and prints it in binary. Use a while loop and remainders after dividing by two - do not use the built-in bin() or the :b format.
Examples
Input
10
Expected output
1010
Rules
Use a
whileloop in this lesson.Do not use
bin().Do not use
format(n, "b").Do not use the
:bformat.
After you submit, 4 hidden tests will also check your solution: zero, one, 255, 1024.
Python starts the first time you run code.
Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.
Input (stdin)
Each line = one call to input().
Output
Hints
Try it yourself first. Each hint reveals a little more - and lowers the reward a little.
Signed out, hints are free - but no XP is awarded either.
Solution
The solution unlocks after the last hint.