


def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if len(SCREAMING_SNAKE_CASE_     ) > 1:
    lowerCamelCase			: Optional[int]   =    len(SCREAMING_SNAKE_CASE_     ) // 2  # Finds the middle of the array
    lowerCamelCase			: Any   =    arr[
        :middle_length
    ]  # Creates an array of the elements in the first half.
    lowerCamelCase			: List[Any]   =    arr[
        middle_length:
    ]  # Creates an array of the elements in the second half.
    lowerCamelCase			: int   =    len(SCREAMING_SNAKE_CASE_     )
    lowerCamelCase			: Tuple   =    len(SCREAMING_SNAKE_CASE_     )
    merge(SCREAMING_SNAKE_CASE_     )  # Starts sorting the left.
    merge(SCREAMING_SNAKE_CASE_     )  # Starts sorting the right
    lowerCamelCase			: Tuple   =    0  # Left Counter
    lowerCamelCase			: Optional[int]   =    0  # Right Counter
    lowerCamelCase			: Dict   =    0  # Position Counter
    while (
        left_index < left_size and right_index < right_size
    ):  # Runs until the lowers size of the left and right are sorted.
      if left_array[left_index] < right_array[right_index]:
        lowerCamelCase			: Union[str, Any]   =    left_array[left_index]
        left_index += 1
      else:
        lowerCamelCase			: List[str]   =    right_array[right_index]
        right_index += 1
      index += 1
    while (
        left_index < left_size
    ):  # Adds the left over elements in the left half of the array
      lowerCamelCase			: Union[str, Any]   =    left_array[left_index]
      left_index += 1
      index += 1
    while (
        right_index < right_size
    ):  # Adds the left over elements in the right half of the array
      lowerCamelCase			: int   =    right_array[right_index]
      right_index += 1
      index += 1
  return arr


if __name__ == "__main__":
   import doctest

   doctest.testmod()







def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if number != int(SCREAMING_SNAKE_CASE_     ):
    raise ValueError("factorial() only accepts integral values"     )
  if number < 0:
    raise ValueError("factorial() not defined for negative values"     )
  lowerCamelCase			: Optional[Any]   =    1
  for i in range(1				,						number + 1     ):
    value *= i
  return value






def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if not isinstance(SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_     ):
    raise ValueError("factorial() only accepts integral values"     )
  if n < 0:
    raise ValueError("factorial() not defined for negative values"     )
  return 1 if n == 0 or n == 1 else n * factorial(n - 1     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   _snake_case					=					int(input('''Enter a positive integer: ''').strip() or 0)
   print(f'''factorial{n} is {factorial(n)}''')



