Question: in python please the questions asks to use the code above, which is the second picture, to compose the function encode_caesar Compose a function encode_caesar

Compose a function encode_caesar which implements the identical functionality, it should accept a variable message, transform it according to the Caesar cipher above, and return a variable encoded grade #define your function here det encade_caesar message) # Set up the encoding dictionary alphabeti : ABCDEFGHIJKLMNOPQRSTUVWXYZ alphabet2 = 'BCDEFGHIJKLMNOPQRSTUMOXYZA { ** YOU WRITE THIS BLOCK (USE THE ABOVE CODE IF YOU NEED HELP) ## Step 1: set up the dictionary with mappings from alphabet to alphabet for i in range(len(alphabeti)): e[alphabet1[1]]-alphabet2[i] Step 2:encode message message:"The Adventures of Sherlock Holmes, by Arthur Conan Doyle message message.upper() encoded for in nessa if in alphabet 1. encodedes else: encodedtre Finally, return the encoded message: return encoded (1): # Set up encoding dictionary alphabet1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ alphabet2 = 'BCDEFGHIJKLMNOPQRSTUVWXYZA' e = { for i in range( len( alphabet1 ) ): e[ alphabet1[i] ] = alphabet2[i] # Set up message to be encoded message = "HELLO" message = message.upper # Encode message encoded - I for c in message: if c in alphabet 1: encoded = e[c1 else: encoded + print("%s encoded becomes %s message, encoded HELLO encoded becomes IFMMP Exercise 1: Encode Caesar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
