как передать 2 аргумент в функцию?
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def encrypt(key, message):
result = ""
for i in message:
if i not in alp:
continue
elif i in alp:
letter = (alp.find(i) + key) % len(alp)
result += alp[letter]
print(result)
return key, result
def decryption(key, result):
message = ""
for i in result:
letter = (alp.find(i) - key) % len(alp)
message += alp[letter]
print(message)
while True:
'encrypt(int(input("Сдвиг: ")),str(input("Сообщение: ")).upper())'
decryption(encrypt(int(input("Сдвиг: ")), str(input("Сообщение: ")).upper()))
Вот весь мой полный код, пайчарм указывает на строчку
decryption(encrypt(int(input("Сдвиг: ")), str(input("Сообщение: ")).upper()))
и выводит TypeError: decryption() missing 1 required positional argument: 'result'
(Этот код - интерпретация шифра цезаря) Мне нужна помощь, как передать аргументы key и result в функцию decryption
Источник: Stack Overflow на русском