Handles I/O :return: void
()
| 75 | |
| 76 | |
| 77 | def 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 | |
| 94 | if __name__ == "__main__": |
no test coverage detected