Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the base case for the sum of digits function?
Think about what happens when there are no digits left.
How can we get the last digit of a number?
What operation gives you the remainder?
What is the correct base case for finding the sum of digits?
What condition signifies the end of recursion?
Recursion can potentially lead to what error?
What happens when the call stack is overused?
Modify the sum_of_digits function to return the product of the digits instead of the sum.
Think about how you would change the operator.
Create a new recursive function that counts how many digits are in a given number.
Consider what defines the count of a number.
5 more questions in this section. Enroll free to practise them all.
Enroll free