Question: A Caesar cipher encrypts a message by shifting letters in the alphabet. For example, a shift of 4 maps 'a' to 'e' and maps 'p'
A Caesar cipher encrypts a message by shifting letters in the alphabet. For example, a shift of 4 maps 'a' to 'e' and maps 'p' to 't' Here is a famous line from Shakespeare encrypted with a shift of 4: vq dg qt pqv vq dg: vjcv ku vjg swguvkqp. (a) Write a program that takes as input a string to be encrypted and an integer en- crpytion shift (such as 4 mentioned above) and prints the encrypted string. Hint: zip() is helpful in building a dictionary. Also, remember to handle spaceit doesnt shift. (b) Extend your program to take an additional input that indicates if your program is to encrypt or decrypt the string.
-need to see the actual code in order to understand the tabbing
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
