input: Write a function to understand recursion in Python by defining a recursive function to calculate the factorial of a number. If the input number is 1, return 1; otherwise, return the product of the number and the factorial of the number minus one. Test the function with the number 5 and print the result.
  assert factorial(5)==120
  # Output: Factorial of 5 is 120
output: def factorial(n):
      if n == 1:
          return 1
      else:
          return n * factorial(n - 1)