CHAPTER 8
RECURTION
CHAPTER OUTLINE
8.1 Recursive Solutions for Problems on Numeric Data
8.2 Recursive Solutions for Problems on Strings
8.3 Recursive Solutions for Problems on Lists
In the previous chapters, we have used functions for various programming tasks. When computation in a function is described in terms of the function itself, it is called a recursive function. Python allows a function to call itself, possibly with new arguments.
Recursion aims to solve a problem by providing a solution in terms of the simpler version of the same problem. A recursive function definition comprises two parts. The first part is the base part, which is the solution of the simplest version of the problem, often termed stopping ...
Get Python Programming: A modular approach now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.