#checkoff5_cipher.py def get_encoding_dictionary(num_positions): """ Inputs: num_positions, an integer between 1 and 26 Returns: a dictionary with 26 keys ('a' through 'z') that maps each lowercase letter of the alphabet to another lowercase letter that is shifted num_positions to the right. Example: get_encoding_dictionary(1) == {"a": "b", "b": "c", ... , "z": "a"} NOTE: don't panic if your dictionary is not in the exact order as the example above. As long as you have the correct mapping for all 26 letters, you will pass our tests. Dictionaries are inherently unordered! (Think: why?) Hint: you may find the modulus operator useful 5 % 26 = 5 27 % 26 = 1 """ ALPHABET = "abcdefghijklmnopqrstuvwxyz" pass def apply_cipher_dict(to_encode, encoding_dict): """ Inputs: to_encode, a string that contains only letters, spaces, commas, and periods. It will not contain tab or newline characters, or any special characters. encoding_dict, a dictionary that contains a mapping of every lowercase letter of the alphabet to another lowercase letter of the alphabet. For example, we may get this dictionary from calling get_encoding_dictionary. NOTE: the inputs may not be modified - you will not pass our test cases if either input is mutated Returns: a tuple, where the first element is the input string to_encode, and the second element is the encoded string. The encoded string is the string to_encode afeter being encrypted using encoding_dict. Commas, periods, and spaces must be preserved. Capitalization does not have to be. Example: apply_cipher_dict("abcde", {"a":"b", ... , "z":"a"}) should return ("abcde", "bcdef") Challenge: preserve capitalization while you encrypt the string to_encode. You may find the string method .isupper() to be useful. (Please write your challenge solution in a separate code file to make testing easier.) """ pass def get_decoding_dictionary(encoding_dict): """ Inputs: encoding_dict, a dictionary that contains a mapping of every lowercase letter of the alphabet to another lowercase letter of the alphabet. NOTE: the input should not be modified Returns: a dictionary that contains a mapping of every encoded lowercase letter of the alphabet to a plaintext lowercase letter of the alphabet. Example: get_decoding_dictionary({"a": "b", ... , "z": "a"}) should return {"a": "z", "b": "a", ... , "z": "y"} Hint: Think before coding this problem! There's a simple trick that will easily get you the solution. Remember, keys are always unique in a dictionary. """ pass