





UpperCamelCase__											= {
    "meter": "m",
    "kilometer": "km",
    "megametre": "Mm",
    "gigametre": "Gm",
    "terametre": "Tm",
    "petametre": "Pm",
    "exametre": "Em",
    "zettametre": "Zm",
    "yottametre": "Ym",
}
# Exponent of the factor(meter)
UpperCamelCase__											= {
    "m": 0,
    "km": 3,
    "Mm": 6,
    "Gm": 9,
    "Tm": 12,
    "Pm": 15,
    "Em": 18,
    "Zm": 21,
    "Ym": 24,
}





def     _UpperCamelCase     (a__   :float   ,			a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							UpperCamelCase__				     =			from_type.lower().strip("""s"""       )
							UpperCamelCase__				     =			to_type.lower().strip("""s"""       )

							UpperCamelCase__				     =			UNIT_SYMBOL.get(a__   ,			a__       )
							UpperCamelCase__				     =			UNIT_SYMBOL.get(a__   ,			a__       )

							if from_sanitized not in METRIC_CONVERSION:
														UpperCamelCase__				     =			(
														    f"""Invalid 'from_type' value: {from_type!r}.\n"""
														    f"""Conversion abbreviations are: {", ".join(a__       )}"""
														)
														raise ValueError(a__       )
							if to_sanitized not in METRIC_CONVERSION:
														UpperCamelCase__				     =			(
														    f"""Invalid 'to_type' value: {to_type!r}.\n"""
														    f"""Conversion abbreviations are: {", ".join(a__       )}"""
														)
														raise ValueError(a__       )
							UpperCamelCase__				     =			METRIC_CONVERSION[from_sanitized]
							UpperCamelCase__				     =			METRIC_CONVERSION[to_sanitized]
							UpperCamelCase__				     =			1

							if from_exponent > to_exponent:
														UpperCamelCase__				     =			from_exponent - to_exponent
							else:
														UpperCamelCase__				     =			-(to_exponent - from_exponent)

							return value * pow(10   ,			a__       )


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

					testmod()











UpperCamelCase__											= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			input("""Enter message: """       )
							UpperCamelCase__				     =			input("""Enter key [alphanumeric]: """       )
							UpperCamelCase__				     =			input("""Encrypt/Decrypt [e/d]: """       )

							if mode.lower().startswith("""e"""       ):
														UpperCamelCase__				     =			"""encrypt"""
														UpperCamelCase__				     =			encrypt_message(a__   ,			a__       )
							elif mode.lower().startswith("""d"""       ):
														UpperCamelCase__				     =			"""decrypt"""
														UpperCamelCase__				     =			decrypt_message(a__   ,			a__       )

							print(f"""\n{mode.title()}ed message:"""       )
							print(a__       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							return translate_message(a__   ,			a__   ,			"""encrypt"""       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							return translate_message(a__   ,			a__   ,			"""decrypt"""       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[]
							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			key.upper()

							for symbol in message:
														UpperCamelCase__				     =			LETTERS.find(symbol.upper()       )
														if num != -1:
																					if mode == "encrypt":
																												num += LETTERS.find(key[key_index]       )
																					elif mode == "decrypt":
																												num -= LETTERS.find(key[key_index]       )

																					num %= len(a__       )

																					if symbol.isupper():
																												translated.append(LETTERS[num]       )
																					elif symbol.islower():
																												translated.append(LETTERS[num].lower()       )

																					key_index += 1
																					if key_index == len(a__       ):
																												UpperCamelCase__				     =			0
														else:
																					translated.append(a__       )
							return "".join(a__       )


if __name__ == "__main__":
					main()




