error showed I am running into a key error while trying to loop through a dictionary. If someone could tell me what I am doing incorrect, it would be helpful. I am trying to make a basic "Caesar cipher", a way to decode messages with an offset of 13. :)
ceasar = {'a':'n', 'b':'o', 'c':'p', 'd':'q', 'e':'r', 'f':'s', 'g':'t', 'h':'u', 'i':'v', 'j':'w', 'k':'x', 'l':'y', 'm':'z', 'n':'a', 'o':'b', 'p':'c', 'q':'d', 'r':'e', 's':'f', 't':'g', 'u':'h', 'v':'i', 'w':'j', 'x':'k', 'y':'l', 'z':'m'}
def ceasar_cipher(encoded):
encoded = encoded.lower()
decoded = ""
for letter in encoded:
if letter == "?" or letter == "!":
decoded += letter
for letter in encoded:
ceasar[letter] += decoded
print decoded