I know that you know that I love you

--Originally published at 101 For Tec

Have you ever heard something like this? Well, in natural language is something common, and oh surprise, in programming also is. In programming we have something that is called recursive functions.

“Recursion is a method of programming or coding a problem, in which a function calls itself one or more times in its body. Usually, it is returning the return value of this function call. If a function definition satisfies the condition of recursion, we call this function a recursive function.

A recursive function has to fulfill an important condition to be used in a program: it has to terminate. A recursive function terminates, if with every recursive call the solution of the problem is downsized and moves towards a base case. A base case is a case, where the problem can be solved without further recursion. A recursion can end up in an infinite loop, if the base case is not met in the calls.”

Here is one example

This code throws the six first lines of the Pascal´s triangle:

pascal.PNG

References:

http://www.python-course.eu/python3_recursive_functions.php