



from __future__ import annotations
def  UpperCamelCase						(       _A			:				list[float]    )->       Union[str, Any]:





						"""simple docstring"""





						A__							=       0.00
						A__							=       0
						for resistor in resistors:
												if resistor <= 0:
																		A__							=       f"""Resistor at index {index} has a negative or zero value!"""
																		raise ValueError(lowerCAmelCase__    )
												first_sum += 1 / float(lowerCAmelCase__    )
												index += 1
						return 1 / first_sum
def  UpperCamelCase						(       _A			:				list[float]    )->       int:





						"""simple docstring"""





						A__							=       0.00
						A__							=       0
						for resistor in resistors:
												sum_r += resistor
												if resistor < 0:
																		A__							=       f"""Resistor at index {index} has a negative value!"""
																		raise ValueError(lowerCAmelCase__    )
												index += 1
						return sum_r


if __name__ == "__main__":
						import doctest

						doctest.testmod()










def  UpperCamelCase						(       _A			:				str    )->       str:





						"""simple docstring"""





						A__							=       ""
						for ch in key:
												if ch == " " or ch not in key_no_dups and ch.isalpha():
																		key_no_dups += ch
						return key_no_dups
def  UpperCamelCase						(       _A			:				str    )->       dict[str, str]:





						"""simple docstring"""





						A__							=       [chr(i + 65    ) for i in range(26    )]
						# Remove duplicate characters from key
						A__							=       remove_duplicates(key.upper()    )
						A__							=       len(_A    )
						# First fill cipher with key characters
						A__							=       {alphabet[i]: char for i, char in enumerate(_A    )}
						# Then map remaining characters in alphabet to
						# the alphabet from the beginning
						for i in range(len(_A    )			,							26    ):
												A__							=       alphabet[i - offset]
												# Ensure we are not mapping letters to letters previously mapped
												while char in key:
																		offset -= 1
																		A__							=       alphabet[i - offset]
												A__							=       char
						return cipher_alphabet
def  UpperCamelCase						(       _A			:				str			,							_A			:				dict[str, str]    )->       str:





						"""simple docstring"""





						return "".join(cipher_map.get(_A			,							_A    ) for ch in message.upper()    )
def  UpperCamelCase						(       _A			:				str			,							_A			:				dict[str, str]    )->       str:





						"""simple docstring"""





						A__							=       {v: k for k, v in cipher_map.items()}
						return "".join(rev_cipher_map.get(_A			,							_A    ) for ch in message.upper()    )
def  UpperCamelCase						(       )->       None:





						"""simple docstring"""





						A__							=       input("Enter message to encode or decode: "    ).strip()
						A__							=       input("Enter keyword: "    ).strip()
						A__							=       input("Encipher or decipher? E/D:"    ).strip()[0].lower()
						try:
												A__							=       {"e": encipher, "d": decipher}[option]
						except KeyError:
												raise KeyError("invalid input option"    )
						A__							=       create_cipher_map(_A    )
						print(func(_A			,							_A    )    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()





