Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for Caesar cipher program #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion cipher.py
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# add your code here
substitution = {
"a": "f",
"b": "g",
"c": "h",
"d": "i",
"e": "j",
"f": "k",
"g": "l",
"h": "m",
"i": "n",
"j": "o",
"k": "p",
"l": "q",
"m": "r",
"n": "s",
"o": "t",
"p": "u",
"q": "v",
"r": "w",
"s": "x",
"t": "y",
"u": "z",
"v": "a",
"w": "b",
"x": "c",
"y": "d",
"z": "e",
}

plain_text = input("Please enter the message you'd like to encrypt: ")
plain_text = plain_text.lower()

encrypted_text = ""
for character in plain_text:
if character in substitution:
character = substitution[character]
encrypted_text += character

print(encrypted_text)