





"""simple docstring"""





def    a__       (       _SCREAMING_SNAKE_CASE     ):




		"""simple docstring"""


		if number != int(__UpperCAmelCase     ):
				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    a__       (       _SCREAMING_SNAKE_CASE     ):




		"""simple docstring"""


		if not isinstance(__UpperCAmelCase	,						__UpperCAmelCase     ):
				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__        =      int(input('''Enter a positive integer: ''').strip() or 0)
						print(f'''factorial{n} is {factorial(n)}''')







"""simple docstring"""







def   __lowerCAmelCase(		__UpperCAmelCase  ,__UpperCAmelCase      ):






	"""simple docstring"""





	if n == 0:
		return 1

	elif n % 2 == 1:
		return binary_exponentiation(__UpperCAmelCase  ,n - 1      ) * a

	else:
		_lowercase			:     Dict      					=				binary_exponentiation(__UpperCAmelCase  ,n / 2      )
		return b * b


if __name__ == "__main__":
						try:
												SCREAMING_SNAKE_CASE						=    int(input('Enter Base : ').strip())
												SCREAMING_SNAKE_CASE						=    int(input('Enter Power : ').strip())
						except ValueError:
												print('Invalid literal for integer')

						SCREAMING_SNAKE_CASE						=    binary_exponentiation(BASE, POWER)
						print(f"""{BASE}^({POWER}) : {RESULT}""")



