Question: Question 5 2 0 Marks I Write a function called text encode that takes in a string and a codebook and for each letter converts
Question
Marks
I
Write a function called text encode that takes in a string and a codebook and for each letter converts it to the encoded version of our text.
The input will be a string of undefined length containing the characters and the literal space
The codebook has to be at least as long as the string being encoded. For each step you will pull a character from the text to encode, and a char from the codebook, encode them and append the result to a string for return.
NOTE that codebooks and input strings used for testing will be valid they will only contain AZ az and and the codebook will be of appropriate length or longer
def textencodetexttoencode:str codebook:str str:
# YOUR IMPLEMENTATION
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
