Log in
← All problems

Reverse a number

easyMaths and loops10 XP

Return the digits of n (0 or more) in reverse order, as a number: 120 becomes 21. Try it with % and // (JavaScript: Math.floor) instead of strings.

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.