Instructions

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%

Flowchart

To enlarge flowchart turn side navigation off, Click on Side Navigation button on in the top navigation bar to change to Side Navigation button off

Flowchart
Flowchart

Starter Code

"""
File: encrypt.py
Project 4.1

Encrypts an input string of the ASCII characters and prints
the result.  The other input is the distance value.
"""

# The ASCII values range from 0 through 127
# Hint: ord('a') = 97 and ord('z') = 122

Image from textbook section 4-2 Data Encryption

Flowchart
Flowchart
Tags: