DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
algorithms for 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
PREVIOUS
NEXT
Tagged:
#algorithms
#Determine
#sum
#al
#digits
ADD COMMENT
Topic
COMMENT
Name
7+5 =
Submit