input: Write a function to understand and implement the concept of recursion in Python. Define a recursive function named `factorial` that calculates the factorial of a given number `n`. If `n` is 1, return 1 as the base case. Otherwise, return `n` multiplied by the factorial of `n-1`. Use this function to calculate the factorial of 5 and print the result. 
  assert factorial(5) == 120
  assert factorial(1) == 1
  assert factorial(0) == 1
  assert factorial(3) == 6
output: def factorial(n):
      if n == 0 or n == 1:
          return 1
      else:
          return n * factorial(n - 1)