SyntaxFix
Write A Post
Hire A Developer
Questions
This might help
def digit_sum(n): num_str = str(n) sum = 0 for i in range(0, len(num_str)): sum += int(num_str[i]) return sum