Recursion. DS301222

We know function being called in other functions but also sometimes it calls by itself.
A function
calling by itself is called recursion.

Ex: def factorial(x):

if x==1:
return 1
else:
return ( x * factorial(x-1))

num = 3
print(“The factorial of”, num, “is”, factorial(num))

3 Likes

@kinnukeshiya
Nice explanation, keep the pace up.

1 Like

Well explained @kinnukeshiya

1 Like