Recursion (computer science)

Method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves from within their own code. The approach can be applied to many types of problems, and recursion is one of the central ideas of computer science.
— Wikipedia

Recursive Tree
Tree created using the Logo programming language and relying heavily on recursion. Each branch can be seen as a smaller version of a tree.

What is this code return?

def test_func(x):
    if x == 0:
        return 0
    return x + test_func(x - 1)
 
print(test_func(10))


55 = 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1

References