human
Give me a code to sum and Product of digits in a number that divide the number and the other steps required given the following:
Sum and Product of digits in a number that divide the number | Print the sum and product of digits that divides the number ..
Fetching each digit of the number.
Checking if digit is greater than 0 and can divides n ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to sum and Product of digits in a number that divide the number and the other steps required.
 def countDigit ( n ) :
	temp = n
	sum = 0
	product = 1
	while ( temp != 0 ) :
		d = temp % 10
		temp //= 10
		if ( d > 0 and n % d == 0 ) :
			sum += d
			product *= d
	print ( " Sum ▁ = " , sum )
	print ( " Product ▁ = " , product )
if __name__ == ' _ _ main _ _ ' :
	n = 1012
	countDigit ( n )