Python Forum
How recursion function is applied?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How recursion function is applied?
#1
What is recursion function in python? can anyone explain it with example?
Reply
#2
https://www.python-course.eu/python3_rec...ctions.php
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
In python, when a function makes a call to itself, it is termed recursion. But then, in order for it to avoid forming an infinite loop, we must have a base condition. Let’s take an example.
>>> def facto(n):
if n==1: return 1
return n*facto(n-1)
>>> facto(4)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Lambda function recursion error DeadlySocks 1 2,008 Apr-13-2020, 05:09 PM
Last Post: deanhystad
  lower() applied at in operator Beerforfree 3 2,258 Mar-22-2020, 11:51 AM
Last Post: ndc85430
  recursion function (python beginner) everafter 3 2,839 Aug-19-2019, 07:24 AM
Last Post: buran
  Recursion, with "some_dict={}" function parameter. MvGulik 3 2,420 Aug-02-2019, 01:34 PM
Last Post: MvGulik
  function call in recursion moong 2 2,240 Feb-17-2019, 09:48 AM
Last Post: moong
  Strip does not work when applied on a string read from a text file. susmis666 1 2,336 Dec-27-2018, 07:07 AM
Last Post: perfringo
  Can't understand the output of this recursion function bigmit37 5 3,902 Apr-04-2017, 11:15 PM
Last Post: Ofnuts
  Applied Graph Theory daniellemmoore 2 3,604 Mar-14-2017, 09:47 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020