'''simple docstring'''




def 						__snake_case (       lowerCAmelCase       :     Optional[int]			):
 if number != int(snake_case_			):
  raise ValueError('factorial() only accepts integral values'			)
 if number < 0:
  raise ValueError('factorial() not defined for negative values'			)
 __UpperCAmelCase         =					1
 for i in range(1      ,  number + 1			):
  value *= i
 return value



def 						__snake_case (       lowerCAmelCase       :     Dict			):
 if not isinstance(snake_case_      ,  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()

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




'''simple docstring'''




def 						__snake_case (       lowerCAmelCase       :     list			):

 for insert_index, insert_value in enumerate(collection[1:]			):
  __UpperCAmelCase         =					insert_index
  while insert_index >= 0 and insert_value < collection[insert_index]:
   __UpperCAmelCase         =					collection[insert_index]
   insert_index -= 1
  if insert_index != temp_index:
   __UpperCAmelCase         =					insert_value
 return collection


if __name__ == "__main__":
     from doctest import testmod

     testmod()

     _UpperCamelCase				:		List[Any]       			=		input('Enter numbers separated by a comma:\n').strip()
     _UpperCamelCase				:		List[Any]       			=		[int(item) for item in user_input.split(',')]
     print(f"{insertion_sort(unsorted) = }")



