これは単純な暗号化方法のコードです。整数除算した余り -Pythonで使用されている '%'記号は正確に何ですか?
if character in alphabet:
position=alphabet.find(character)
newPosition=(position-key)%26 # here
newCharacter=alphabet[newPosition]
print("The encrypted character is: " + newCharacter)
newMessage += newCharacter
print(newMessage)
https://en.wikipedia.org/wiki/Modulo_operation – khelwood
読み取りがありヒント:英語にはいくつの文字があり、ASCIIには何文字ですか? – zaph