# Python program to display the factorial(n) using recursive functions # factorial(n) = n * n-1 * n-2 * ... * 1; factorial of zero = 1 def recur_factorial(n): """Recursive function to calculate factorial""" if n == 0 or n == 1: return 1 else: return(n * recur_factorial(n-1)) # Take input from the user num = int(input("Enter a number greater than or equal to 1: ")) # check if the number is valid if num < 0: print("Please enter a positive integer.") else: print(str(num) + " factorial is: ") print(recur_factorial (num))