Skip to content
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)