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
16 changes: 15 additions & 1 deletion cipher.py
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# add your code here
alphabet = "abcdefghijklmnopqrstuvwxyz"

shift = int(input("Please enter number of places to shift:"))
plain_text= input("Please enter a sentence: ")

encrypted_text = ""

for char in plain_text:
if char in alphabet:
index = alphabet.find(char)
index = (index + shift) % 26
char = alphabet[index]
encrypted_text += char

print(encrypted_text)