1.4 digit_sum simple soultion?


#1



My solution for the digit_sum problem. I checked the other solutions after I finished and some of them seem overly complex. Is there anything wrong with this solution?


def digit_sum(n):
    total = 0
    for item in str(n):
        total += int(item)
    return total


#3

This is a very good solution :slight_smile: Some people come up with more complex solution, coming up with a good solution without looking at the forum is difficult, impressive you pulled it off :slight_smile: