human
Write me a code to reverse and Add Function and the other steps required given the following:
Reverse and Add Function | Iterative function to reverse digits of num.
Function to check whether the number is palindrome or not.
Reverse and Add Function.
Reversing the digits of the number.
Adding the reversed number with the original.
Checking whether the number is palindrome or not.
Driver Code"
Solution in Python:
assistant
#Here is code to reverse and Add Function and the other steps required.
 def reversDigits ( num ) :
	rev_num = 0
	while ( num > 0 ) :
		rev_num = rev_num * 10 + num % 10
		num = num / 10
	return rev_num
def isPalindrome ( num ) :
	return ( reversDigits ( num ) == num )
def ReverseandAdd ( num ) :
	rev_num = 0
	while ( num <= 4294967295 ) :
		rev_num = reversDigits ( num )
		num = num + rev_num
		if ( isPalindrome ( num ) ) :
			print num
			break
		else :
			if ( num > 4294967295 ) :
				print " No ▁ palindrome ▁ exist "
ReverseandAdd ( 195 )
ReverseandAdd ( 265 )