Question: Please answer in Python. Exercise Type these expressions in the python shell. > ord (a) >chr(97) ord (a) +5 > ord (A) > ord (

Please answer in Python.

Please answer in Python. Exercise Type these expressions in the python shell.

Exercise Type these expressions in the python shell. > ord ("a") >chr(97) ord ("a") +5 > ord ("A") > ord (" z ") chr(102) chr(ord("f")5) Problem 1 Write a recursive function encode that takes a string as an input. For each character in the string add 5 to its ord value and then convert it to a character by using chr. Also write another function decode that takes a string as input and subtracts 5 from each character to return the original string. Note that number 5 acts as a key which the person encoding and decoding must have to decipher the message. Each character on the keyboard has an equivalent ord number which comes from the ASCII table. (See ASCII table - https://ascii.cl/). [Hint: Remember string are like list hence they can be manipulated like lists] encode ("hello") 'mjqqt' > decode ("mjqqt") 'hello

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!