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, 03.07.2019 14:10
The y form of iron is known as: a) ferrite b) cementite c) perlite d) austenite
Answers: 3
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
question
Engineering, 04.07.2019 18:10
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
You know the right answer?
Write a code block to encode strings into a secret message. Your code will presume a number, stored...
Questions
question
Spanish, 07.05.2021 19:30
question
Mathematics, 07.05.2021 19:30
question
Mathematics, 07.05.2021 19:30
question
Mathematics, 07.05.2021 19:30
question
Mathematics, 07.05.2021 19:30
Questions on the website: 13722363