def encrypt(string): reversed_string = string\[::-1\] encrypted_string = reversed_string.replace('e', '3').replace('a', '4') return encrypted_stringdef decrypt(string): decrypted_password = string.replace('3', 'e').replace('4', 'a') reversed_string = decrypted_password\[::-1\] return reversed_stringstring = input("Insert a message: ")encrypted_word = encrypt(string)print("Encrypted Message: ", encrypted_word)decrypted_word = decrypt(encrypted_word)print("Decrypted Message: ", decrypted_word)
This functions are correct? I don't know if the encrypted function is 100% right