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 5
20 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 A-Z,a-Z 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 A-Z, a-z and '' and the codebook will be of appropriate length or longer).
def text_encode(text_to_encode:str, codebook:str) str:
# YOUR IMPLEMENTATION
 Question 5 20 Marks I Write a function called text encode

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!