subject
Engineering, 24.04.2020 04:29 Chartwig1908

Write a code block to encode strings into a secret message. Your code will presume a number, stored in key, and a message to encode, stored as a string variable called message. Don't define these variables in your code - they will be defined when you run the tests.

To do so:
Initialize a variable called encoded as an empty string
Use a for loop to loop across all characters of a string variable message
Inside the loop, convert the character to another character:
Get the unicode code point for the character (using ord)
Add the value of key to that code point (which should be an int)
Convert this new int back to a character (using chr).
Also inside the loop, add this converted char to the string encoded

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Aflywheel accelerates for 5 seconds at 2 rad/s2 from a speed of 20 rpm. determine the total number of revolutions of the flywheel during the period of its acceleration. a.5.65 b.8.43 c. 723 d.6.86
Answers: 2
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
You know the right answer?
Write a code block to encode strings into a secret message. Your code will presume a number, stored...
Questions
Questions on the website: 13722367