human
What is a code to program to check if a number is divisible by sum of its digits and the other steps required given the following:
Program to check if a number is divisible by sum of its digits | Python implementation of above approach.
Converting integer to string.
Initialising sum to 0.
Traversing through the string.
Converting character to int.
Comparing number and sum.
Driver Code.
passing this number to get result function"
Solution in Python:
assistant
#Here is code to program to check if a number is divisible by sum of its digits and the other steps required.
 def getResult ( n ) :
	st = str ( n )
	sum = 0
	length = len ( st )
	for i in st :
		sum = sum + int ( i )
	if ( n % sum == 0 ) :
		return " Yes "
	else :
		return " No "
n = 123
print ( getResult ( n ) )