PYTHON!!!!! Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher. The script should work for any printable characters. An example of the program input and output is shown below: Enter a message: Hello world! Enter the distance value: 4 Lipps${svph% Program produces correct output given input: Input: Hello world 4 Output: ['c', 'd', 'e'] Hello world 4 Results: Lipps${svph Input: Call me Ishmael. 7 Output: ['c', 'd', 'e'] Call me Ishmael. Results: Jhss'tl'Pzothls5 Input: Where must we go, we who wander this wasteland, in search of our better selves? 2 Output: ['c', 'd', 'e'] Where must we go, we who wander this wasteland, in search of our better selves? 2 Results: Yjgtg"owuv"yg"iq."yg"yjq"ycpfgt"vjku"ycuvgn
PYTHON!!!!!
Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher.
The script should work for any printable characters.
An example of the program input and output is shown below:
Enter a message: Hello world!
Enter the distance value: 4
Lipps${svph%
Program produces correct output given input:
Input:
Hello world
4
Output:
['c', 'd', 'e']
Hello world
4
Results:
Lipps${svph
Input:
Call me Ishmael.
7
Output:
['c', 'd', 'e']
Call me Ishmael.
Results:
Jhss'tl'Pzothls5
Input:
Where must we go, we who wander this wasteland, in search of our better selves?
2
Output:
['c', 'd', 'e']
Where must we go, we who wander this wasteland, in search of our better selves?
2
Results:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images