unencryptionKey = (-16)
# Caesar Cypher Encryption
def passwordunEncrypt(encryptedMessage, key):
# We will start with an empty string as our encryptedMessage
encryptedMessage = ''
# For each symbol in the unencryptedMessage we will add an encrypted symbol into the encryptedMessage
for symbol in 'encryptedMessage':
if symbol.isalpha():
num = ord(symbol)
num += unencryptionKey
When I run the above code it tells me that, in the last line, 'unencryptionKey' is undefined. In the first line it shows exactly what 'unencryptionKey' is. Why the error? In the original code the term in the last line was just 'key' so I changed it as I assume they mean unencryptionKey is to be used and thought tying it to the first line would allow it to run. I tried to screenshot so the line numbers would be included but it didn't work so had to cut and paste.