Practice Memory Diagram


Snippet

    def sum_of_digits(n):
        if n == 0:
            return 0
        else:
            return (n % 10) + sum_of_digits(n // 10)

    print(sum_of_digits(123))
    print(sum_of_digits(4567))

Solution

(Coming Soon)

Image Description

(Coming Soon)

Contributor(s): Viktorya Hunanyan