Question: Q . 1 2 Cipher A Caesar cipher encrypts a message by shifting letters in the alphabet. For example, a shift of 4 maps '

Q.12 Cipher
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 2: 'vq dg qt pqv vq dg: vjcv ku vjg
swguvkqp.'
(1) Write a program that takes as input a string to be encrypted and an integer encryption shift (such as 2 mentioned
earlier), and prints the encrypted string. [Hint: zip() is helpful in building a dictionary. Also, remember to
handle space it doesn't shift].
(2) Extend your program to take an additional input that indicates if your program is to encrypt or decrypt the
string.
write in python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!