Write a recursive function to compute the factorial of a number.
Solution:
def factorialRec(num): if num <= 1: return 1 return factorialRec(num - 1)
def readInput(): while True: num = input("Enter…