human
Give me a code to number is divisible by 29 or not and the other steps required given the following:
Number is divisible by 29 or not | Returns true if n is divisible by 29 else returns false ..
add the lastdigit * 3 to renaming number until number comes only 2 digit.
return true if number is divisible by 29 another.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to number is divisible by 29 or not and the other steps required.
 def isDivisible ( n ) :
	while ( int ( n / 100 ) ) :
		last_digit = int ( n % 10 )
		n = int ( n / 10 )
		n += last_digit * 3
	return ( n % 29 == 0 )
n = 348
if ( isDivisible ( n ) != 0 ) :
	print ( " Yes " )
else :
	print ( " No " )