What is recursion?

Question

Give an example.

in progress 0
Dhruv2301 55 years 2 Answers 708 views Great Grand Master 0

Answers ( 2 )

  1. When a function calls itself it is known as recurssion.
    For example:

    def factorial(n):
    if(i==0 || i==1):

  2. When a function calls itself it is known as recurssion.
    For example:

    def factorial(n):
    if(i==0 || i==1):
    return 1
    else
    return n*factorial(n-1)

Leave an answer

Browse
Browse