Practice ยท 1 of 1
Digit Sum
Implement digit_sum(n): sum of the decimal digits of a non-negative integer. Use % 10 and / 10 in a while loop.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: While Practice: Search and Validate