Write a program to extract and print digits of a number in reverse order. The number is input from user.


Topic: Write a program to extract and print digits of a number in reverse order. The number is input from user.

Solution

num = int(input("Enter a number with multiple digit: "))
n=0
while num>0:
    a = num%10
    num = num - a
    num = num/10
    print(int(a),end="")
    n = n + 1



List all Python Programs