code: 
  
  
  
  def 			__lowercase     (				a__     )       ->				int:
  							if number != int(a__     ):
  														raise ValueError('factorial() only accepts integral values'     )
  							if number < 0:
  														raise ValueError('factorial() not defined for negative values'     )
  							__SCREAMING_SNAKE_CASE								=      1
  							for i in range(1							,     number + 1     ):
  														value *= i
  							return value
  
  
  
  
  
  
  def 			__lowercase     (				a__     )       ->				int:
  							if not isinstance(a__							,     a__     ):
  														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()
  
  			lowerCAmelCase__	:  List[str] 		=int(input('''Enter a positive integer: ''').strip() or 0)
  			print(F'''factorial{n} is {factorial(n)}''')
  
  
  
  
  
  
  
style_context: 
  
  
  
  def 			__lowercase     (				a__							,     a__     )       ->				List[str]:
  							if n == 0:
  														return 1
  
  							elif n % 2 == 1:
  														return binary_exponentiation(a__							,     n - 1     ) * a
  
  							else:
  														__SCREAMING_SNAKE_CASE								=      binary_exponentiation(a__							,     n / 2     )
  														return b * b
  
  
  if __name__ == "__main__":
  			try:
  						lowerCAmelCase__	:  str 		=int(input('''Enter Base : ''').strip())
  						lowerCAmelCase__	:  Optional[int] 		=int(input('''Enter Power : ''').strip())
  			except ValueError:
  						print('''Invalid literal for integer''')
  
  			lowerCAmelCase__	:  Any 		=binary_exponentiation(BASE, POWER)
  			print(F'''{BASE}^({POWER}) : {RESULT}''')
  
  
  
  
  
  
  