Engineering
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

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, keigleyhannah30
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
image
Engineering, 04.07.2019 18:10, DestyHilBan1183
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
image
Engineering, 04.07.2019 18:10, alyssabailey7545
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
Answers: 1
image
Engineering, 04.07.2019 18:10, lerasteidl
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
Do you know the correct answer?
Write a code block to encode strings into a secret message. Your code will presume a number, stored...

Questions in other subjects:

Konu
Mathematics, 01.03.2021 01:00