MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / main

Function main

ciphers/simple_keyword_cypher.py:77–91  ·  view source on GitHub ↗

Handles I/O :return: void

()

Source from the content-addressed store, hash-verified

75
76
77def main() -> None:
78 """
79 Handles I/O
80
81 :return: void
82 """
83 message = input("Enter message to encode or decode: ").strip()
84 key = input("Enter keyword: ").strip()
85 option = input("Encipher or decipher? E/D:").strip()[0].lower()
86 try:
87 func = {"e": encipher, "d": decipher}[option]
88 except KeyError:
89 raise KeyError("invalid input option")
90 cipher_map = create_cipher_map(key)
91 print(func(message, cipher_map))
92
93
94if __name__ == "__main__":

Callers 1

Calls 2

create_cipher_mapFunction · 0.85
funcFunction · 0.85

Tested by

no test coverage detected