191k views
4 votes
Write a code block to decode strings from secret encodings back to readable messages. To do so: Initialize a variable called decoded as an empty string Use a for loop to loop across all characters of a presumed string variable called encoded Inside the loop, convert the character to another character: Get the unicode code point for the character (using ord) Subtract the value of key to that code point (which should be an int) This undoes the secret encoding of the character, getting back to the original value Convert this new int back to a character (using chr). Also inside the loop, add this converted character to the string decoded

User Ajmajmajma
by
5.0k points

1 Answer

1 vote

Answer:

The answer is provided in the attached document.

Step-by-step explanation:

The explanation is provided in the attached document.

Write a code block to decode strings from secret encodings back to readable messages-example-1
User Chinh Nguyen
by
5.5k points