def factorial(n): if n == 0: return 1; else: return n*factorial(n-1) print(factorial(5)) #Output 120 Share on FacebookTweetFollow usSave Related Examples 1. A Python program to print Fibonacci series upto n number with the help of recursion.