← Problem book: Python Lesson 96 of 96 · 10 XP

Binary notation with recursion

Theory and problem statement

Machine translation, not yet reviewed by a native speaker.

Write a recursive function that prints a non-negative number in binary: first the binary notation of n // 2, then the last digit n % 2. For 0 print 0.

Example

Input:

5

Output:

101

Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.