Python Program to Reverse a Number



In this program we will print the reverse of a given number.



  1. #Reverse a number
  2. a=int(input("Enter an integer: "))
  3. reverse=0
  4. while(a is not 0):
  5. rem = a%10
  6. reverse = reverse*10 + rem
  7. a //= 10
  8. print("Reverse of the number is: ", reverse)

Output


Output!