© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. IndenPython Challengeshttps://doi.org/10.1007/978-1-4842-7398-2_3

3. Recursion

Michael Inden1  
(1)
Zurich, Switzerland
 

In nature and mathematics, you can find the topic self-similarity or recurring structures, such as snowflakes, fractals, and Julia sets, which are interesting graphical formations. In this context, one speaks of recursion, meaning that things repeat or resemble each other. Related to methods, this means that they call themselves. Important therefore is a termination condition in the form of special input values, which leads to the end of the self calls.

3.1 Introduction

Various computations can be described as recursive functions. The goal ...

Get Python Challenges: 100 Proven Programming Tasks Designed to Prepare You for Anything 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.