



def 				_lowerCAmelCase      (_lowerCAmelCase):
					if number != int(_lowerCAmelCase):
										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 				_lowerCAmelCase      (_lowerCAmelCase):
					if not isinstance(_lowerCAmelCase				,		_lowerCAmelCase):
										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				:							List[Any]								=int(input("""Enter a positive integer: """).strip() or 0)
	print(F"factorial{n} is {factorial(n)}")





from typing import Literal

UpperCAmelCase				:							Tuple								="""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""



def 				_lowerCAmelCase      (_lowerCAmelCase				,		_lowerCAmelCase				,		_lowerCAmelCase):
					UpperCamelCase_											=				LETTERS if mode == "decrypt" else key
					UpperCamelCase_											=				key if mode == "decrypt" else LETTERS
					UpperCamelCase_											=				""
					# loop through each symbol in the message
					for symbol in message:
										if symbol.upper() in chars_a:
															# encrypt/decrypt the symbol
															UpperCamelCase_											=				chars_a.find(symbol.upper())
															if symbol.isupper():
																				translated += chars_b[sym_index].upper()
															else:
																				translated += chars_b[sym_index].lower()
										else:
															# symbol is not in LETTERS, just add it
															translated += symbol
					return translated



def 				_lowerCAmelCase      (_lowerCAmelCase				,		_lowerCAmelCase):
					return translate_message(_lowerCAmelCase				,		_lowerCAmelCase				,		"encrypt")



def 				_lowerCAmelCase      (_lowerCAmelCase				,		_lowerCAmelCase):
					return translate_message(_lowerCAmelCase				,		_lowerCAmelCase				,		"decrypt")



def 				_lowerCAmelCase      ():
					UpperCamelCase_											=				"Hello World"
					UpperCamelCase_											=				"QWERTYUIOPASDFGHJKLZXCVBNM"
					UpperCamelCase_											=				"decrypt"  # set to 'encrypt' or 'decrypt'

					if mode == "encrypt":
										UpperCamelCase_											=				encrypt_message(_lowerCAmelCase				,		_lowerCAmelCase)
					elif mode == "decrypt":
										UpperCamelCase_											=				decrypt_message(_lowerCAmelCase				,		_lowerCAmelCase)
					print(f"""Using the key {key}, the {mode}ed message is: {translated}""")


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()
