human
Recursive program to check if number is palindrome or not | Recursive function that returns the reverse of digits.
base case.
stores the reverse of a number.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to recursive program to check if number is palindrome or not and the other steps required.
 def rev ( n , temp ) :
	if ( n == 0 ) :
		return temp ;
	temp = ( temp * 10 ) + ( n % 10 ) ;
	return rev ( n / 10 , temp ) ;
n = 121 ;
temp = rev ( n , 0 ) ;
if ( temp != n ) :
	print ( " yes " ) ;
else :
	print ( " no " ) ;