Module 6 introduced a function that calls itself, with a base case and a smaller problem. Recursion earns its place when the data or the problem is itself nested: a folder inside a folder, a list inside a list, a problem that splits into halves. This lesson shows those shapes, the trap of repeating the same work, and how to recognise when a loop is the better tool.
More lessons in Complete Python Programming