Codecademy Forums
Digit_sum()
Community
methodslayer60004
June 27, 2017, 9:23pm
1
def digit_sum(n):
sum = 0
for i in str(n):
val = int(i)
sum += val
return sum
Related topics
Topic
Replies
Views
Activity
Practice makes perfect 4/15
Community
1
739
September 30, 2017
Help in understanding this concept?
Community
2
444
June 17, 2018
FAQ: Learn Python - Practice Makes Perfect - digit_sum
Python FAQ
50
5567
December 1, 2023
Practice makes perfect Exercise digit_sum
Community
3
433
June 2, 2018
4/15 Practice makes perfect digit_sum
Community
11
641
December 31, 2017