def decode(cipher, shift):
    letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
new_cipher = []
for letter in cipher:
    new_cipher.append(letters[letters.index(letter) - shift])
return ''.join(new_cipher)
Changing the letters of a string