Как мне завершить этот проект?
def encode(message, shift): message = message.lower() secret = "" for c in message: if c in "abcdefghijklmnopqrstuvwxyz": num = ord(c) num += shift if num > ord("z"): num -= 26 elif num < ord("a"): num += 26 secret = secret + chr(num) else: secret = secret + c return secret # this line does nothing. Remove it when you complete the method. def decode(message, shift): pass # this line does nothing. Remove it when you complete the method. def main(): msg = input("Your message to encode? ") if len(msg) > 0: secret = encrypt(msg) print("The encoded message is:", secret) else: secret = input("Your message to decode? ") if len(secret) > 0: msg = decrypt(secret) print("The decoded message is:", msg) # this line does nothing. Remove it when you complete the method. ---"I do not know how to make decode line"--- ######################################################################## ### Do not modify anything below here ### ######################################################################## if __name__ == '__main__': main()
Что я уже пробовал:
Я не смог завершить линию декодирования