Question: The encoder program should take in a variable x as an input. It should then display that same message but with each letter in the
The encoder program should take in a variable x as an input. It should then display that same message but with each letter in the message replaced with the letter that is x number of places further back in the alphabet. ie if x then d becomes ac becomes zb becomes y etc. The encoded message is output to the terminal.
Write a second program that can decipher a message. It takes two inputs. Variable "offset" determines the number of places ahead in the alphabet to replace iea becomes d while the second input takes the secret message. Output should just be the deciphered message.
Take turns writing a secret message and sending it to your teammate to decode. If you are able to translate it back to the original message, your program is working correctly.
For example, one user will run:
python cipher.py
hello
A message will be output which is the string "ebiil".
To decipher, you would run:
python decipher.py
ebiil
and obtain "hello" as output.
in python
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
