Answers for "given n, take the sum of the digits of n. if that value has more than one digit,"

1

Determine the sum of al digits of n

def sum_of_digits(n): 
	sum = 0
	while (n != 0): 
		sum = sum + int(n % 10) 
		n = int(n/10) 
	return sum
Posted by: Guest on October-20-2020

Code answers related to "given n, take the sum of the digits of n. if that value has more than one digit,"

Python Answers by Framework

Browse Popular Code Answers by Language