Я должен закончить и обновить этот код. Он имеет дело с шифром Цезаря, с ключом, чтобы найти зашифрованное слово. Вот программа, если вы можете помочь мне, например, скажите мне, что добавить или что-нибудь. (Извините за мой английский, я француз.)
def caesar_crypt(input_str, key):
output_str = ''
for c in input_str:
co = ord(c)
# Only crypt capital letters
if 65 <= ord(c) <= 90:
co = co + key
# Deal with when we go outside the alphabet
if co > 90:
co = co - 26
elif co < 65:
co = co + 26
output_str += chr(co)
return output_str
string_to_crypt = input("Enter the message you cant to crypt").upper()
key = int(input("Which key (integer between 1 and 25) do you want to use ?"))
print("The crypted text is the following")
print(caesar_crypt(string_to_crypt, key))