That concludes your journey through recursion, a programming technique in which a function calls itself. Recursion isn’t by any means appropriate for every task. But some programming problems virtually cry out for it. In those situations, it’s a great technique to have at your disposal.
In this video course, you learned:
- What it means for a function to call itself recursively
- When recursion might be your best best for solving a problem
- How you can implement recursion for various use cases in Python
You also saw several examples of recursive algorithms and compared them to corresponding non-recursive solutions.
You should now be in a good position to recognize when recursion is called for and be ready to use it confidently when it’s needed!