Log in
← All problems

Decimal to binary

mediumMaths and loops20 XP

Return the binary form of n (0 or more) as a string of 0s and 1s, without using built-in conversion: keep dividing by 2 and collect the remainders.

Examples

Examples use JSON: true/false/null are True/False/None in Python.

Run examples checks the examples above. Submit also runs 4 hidden tests.