input: Write a python function to calculate the factorial of a positive number.
  ```python
  def factorial(num):
      if num == 0:
          return 1
      result = 1
      for i in range(1, num + 1):
          result *= i
      return result
  
  assert factorial(4) == 24
  assert factorial(5) == 120
  assert factorial(0) == 1
  assert factorial(6) == 720
output: def factorial(num):
      if num == 0:
          return 1
      result = 1
      for i in range(1, num + 1):
          result *= i
      return result