Recursion refers to the technique in which a function calls itself to accomplish a task. There are two types of recursion, structural and generative. Structural recursion is one where one of the parameters of the recursive function is a recursive data type. In generative recursion, the parameters are not recursive objects but they are still used to recursively carry out a task. An example of a recursive data type is a nested list.
Recursion is used when the way the whole is found out is the same as the way each part is found out. While some recursive code can be written using for loops instead, it is not always possible. Recursion is also more readable and it is useful when dealing with data structures like trees.
After that, we were introduced to two more built-in features: conditional/functional if and any(). Functional if is used when we want some expression to be evaluated when a condition is satisfied and another expression otherwise. For example, in a case where we return something if condition x is true, and return another if otherwise. Any is used to check if there is at least one thing that is true in a given list.
I look forward to learning more about recursion and to using it in some application soon.