Advertisement



< Prev
Next >



Python - Recursive function





Recursion is a technique by which a function calls itself from its own code. A function that can call itself from its own code is said to be a "recursive function". Using Python language, we can execute this technique and can make a function call itself to do a specific task.


To understand the technique of recursion, we will create two programs to do the same task of printing numbers from 1 to 5 in successive steps. For example -
In the first program, we will see a simple function(a non-recursive function) performing the task and in the second program, we will implement a recursive function doing the same task.




Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement

Notifications



Please check our latest addition

PYTHON


Advertisement