Exercises for Lesson 25

Back to Lesson 25

Exercise 1: Summing numbers, recursively

Write a function that returns the sum of the numbers from 1 to n. It should use a recursive approach.

def recursiveSum(n):
    return 0 # TODO

Exercise 2: Reversing a string, recursively

Write a function that returns the reverese of a string. It should use a recursive approach.

def recursiveReverse(s):
    return 0 # TODO

Exercise 3: Finding anagrams of a string, recursively

Write a function that returns a list of all of the anagrams of a given string. It should use a recursive approach.

def recursiveAnagram(s):
    return 0 # TODO

Back to Lesson 25