#!/usr/bin/python3 # -*- coding: utf-8 -*- print("You have to run this program, once for every character of your message") key: int = int(input("\nEnter your Caesar key in numeric form (1-25): ")) mode: int = int(input("\nEnter 1 for encryption, and 0 for decryption: ")) encoded_char: int = int( input( "\nEnter Caesar encoded number corresponding to one character of your message:" ) ) print("\nThe translation of your character is:") if mode == 1: # 26 is the symbol set size (# letters in alphabet) if (encoded_char + key) < 26: print(encoded_char + key) else: print((encoded_char + key) - 26) else: # 26 is the symbol set size (# letters in alphabet) if 0 < (encoded_char - key): print(encoded_char - key) else: print((encoded_char - key) + 26)