Sign in to test your solution.
# Caesar cipher program # ------------------------- # Subprograms # ------------------------- def encrypt_message(message): key = 5 encrypted_message = "" for character in message: ascii_code = ord(character) ascii_code = ascii_code + key if ascii_code > 126: ascii_code = 32 + ascii_code - 127 encrypted_message = encrypted_message + chr(ascii_code) return encrypted_message # ------------------------- # Main program # ------------------------- actual_message = input("Enter a message: ") stored_message = encrypt_message(actual_message) print("Message to send:", stored_message)

  Python sandbox

This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.

Test case being debugged