diff --git a/cipher.py b/cipher.py index 0e772db..b82ffa0 100644 --- a/cipher.py +++ b/cipher.py @@ -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)