class

Post date: Mar 22, 2016 2:38:11 PM

abc = "abcdefghijklmnopqrstuvwxyz"

def encoding(cChar):

i = -1

for x in range(0, len(abc)):

if abc[x] == cChar:

i = x

break

if i == -1:

return cChar

return abc[i - 2]

text = input("Give me a message to encode:")

sMsg = ""

for x in range (0, len(text)):

sMsg = sMsg + encoding(text[x])

print(sMsg)