Success!!! Thank you for the help. It was nice to see I wasn't too far from being correct. This is the most intricate program I've written so far. [edited] Ok, got a little ahead of myself. I tried the decrypter portion of the program and got a traceback error of
Error:encrypted_message += chr(x + 65)
NameError: name 'encrypted_message' is not defined
should I remove the method == str("decrypt") and change the elif back to an else?message = input("Enter the message you wish to encrypt or decrypt:") shift_key = int(input("Enter the key value:")) method = str(input("Would you like to encrypt or decrypt a message?")) if method != str("encrypt") and method != str("decrypt"): method = input("Enter either encrypt or decrypt") else: if method == str("encrypt"): encrypted_message = "" for character in message: if character.isalpha() == True: if character == character.lower(): x = ord(character) -97 x += int(shift_key) x = x % 26 encrypted_message += chr(x + 97) else: x = ord(character) -65 x += int(shift_key) x = x % 26 encrypted_message += chr(x + 65) else: encrypted_message += character print(encrypted_message) elif method == str("decrypt"): decrypted_message = "" for character in message: if character.isalpha() == True: if character == character.lower(): x = ord(character) -97 x += int(-shift_key) x = x % 26 encrypted_message += chr(x + 97) else: x = ord(character) -65 x += int(-shift_key) x = x % 26 encrypted_message += chr(x + 65) else: decrypted_message += character print(decrypted_message)