Programming Examples
Python recursive function to print the reverse of number
Write a recursive function to print the reverse of given number.
Solution:
def reverse(num):
  if num<10:
    print(num)
  else:
    print(num%10,end='')
     reverse(num//10)
n=int(input("Enter any Number : "))
reverse(n)
Output
Enter any Number : 576
675