11 Program to reverse a given number using Python

Program:

num = int(input("Enter any number:"))

onum = num

rnum = 0

while num > 0:

    rem = num % 10

    rnum = (rnum * 10) + rem

    num = num // 10



print("Original Number:",onum)

print("Reverse Number:",rnum)


Output:
reverse a given number using Python

Previous
Next Post »