human
Can you provide a code to check if the sum of digits of a number N divides it and the other steps required given the following:
Check if the sum of digits of a number N divides it | Function to check if sum of digits of a number divides it.
Calculate sum of all of digits of N.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to check if the sum of digits of a number N divides it and the other steps required.
 def isSumDivides ( N ) :
	temp = N
	sum = 0
	while ( temp ) :
		sum += temp % 10
		temp = int ( temp / 10 )
	if ( N % sum == 0 ) :
		return 1
	else :
		return 0
if __name__ == ' _ _ main _ _ ' :
	N = 12
	if ( isSumDivides ( N ) ) :
		print ( " YES " )
	else :
		print ( " NO " )