Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IMPORTANT: make sure that you use create Alphabet() as the helper function to generate the alphabet used by the encryption/decryption routines. You should be able
IMPORTANT: make sure that you use create Alphabet() as the helper function to generate the alphabet used by the encryption/decryption routines. You should be able to change the alphabet returned by create Alphabet() and all your other functions should still work correctly. def create Alphabet(): create Alphabet returns a string that includes all lowercase letters, followed by all upper-case letters, then a space, a comma, a period, a hyphen('-'), a tilde(''), and a pound symbol ('#'). NOTE: the order of characters in the alphabet is very important! In other words, the string being returned will be 'abcdef...XYZABCDEF...XYZ ,.--# (the ellipses .. hide the alphabet letters) Ic = string.ascii_lowercase uc = string.ascii_uppercase return lc + UC +",--" getCharacterBackward(char, key) - return left-shifted character. After being called, it gets the character to the left of char by moving "backward" by the specified key positions in the alphabet. For example, if you this function with the parameter "c" and 2 the result is "a" and if you call it with "a" and len(create Alphabet()) the result is "a" because you are essentially moving over all the characters and so the result is the initial character. def getCharacterBackward(char, key): Given a character char, and an integer key, the function shifts char backward `key` steps. Return the new character. If char' is not a single character, return 'None'. If key is not an integer, return -1. return "stub" PLEASE ONLY USE FOR OR WHILE LOOP
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started