Question: IN Python Please Part II: Encode Letter Differences (20 points) While solving this problem you will need to use the ord ) function, which takes

IN Python Please

IN Python Please Part II: Encode Letter Differences (20 points) While solving

this problem you will need to use the ord ) function, which

Part II: Encode Letter Differences (20 points) While solving this problem you will need to use the ord ) function, which takes a character as its argument and returns an integer called its Unicode value. The Unicode value is the number used inside the computer's memory to store the character. For example, the uppercase letter A has the Unicode value 65, so ord ('A') returns 65. As another example, the lowercase letter z has the Unicode value 122, so ord('z') returns 122. Complete the function encode_steps, which takes one argument, message, a non-empty string of upper case and lowercase letters. The function iterates over the message string one character at a me, computing the difference in Unicode code values between adjacent characters. More specifically, the code of the "earlier" character is subtracted from the code of the "later" character. For example, suppose we have the string "Worf". The respective Unicode values of these characters are 87, 111, 114 and 102. Therefore, the differences are 24 (24-1 i 1-87), 3 (3-1 14-111) and-12 (-12-102-114). The returned string is assembled by inserting the Unicode differences between adjacent characters. Continuing this example, for the argument string Worf' the returned value would be the string W24o3r-12f CSE 101-Spring 2018 Lab #9 Page 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!