Editor

Reverse a Number

Programs with input · Beginner · about 6 min

Read a whole number greater than 0 and print its digits in reverse order as Reversed: 4321. Print the result as a number, so zeros at the start disappear: 1200 reversed is Reversed: 21.

The prompts inside input() are not checked, only what you print.

Example

You type:

1234

The program prints:

Reversed: 4321
n = int(input("Number: "))
# Build the reversed number and print it
The solution opens after your first Check.