Question
Create a function that will take a phrase and either coded or decode the phrase (use only lowercase letters and spaces).1.Name function Cypher.py with two
Create a function that will take a phrase and either coded or decode the phrase (use only lowercase letters and spaces).1.Name function Cypher.py with two inputs and one output.2.The first input is a string to code or decode and the second input is an integer where 0 tells the function code and 1 tells it to decode the string. The one output is then converted to a string. 3.Choose a cypher code and enter your cypher as a dictionaryex.{"a": "n",...}The code must include an alternate character for each of the 26 letters and a space. (Do not repeat any characters.) 4.Create an equivalent de-cypher key and enter it as a de-cypher dictionary which could be used to return the code into the original characters.5.Loop through the characters in the phrase and find each letter in the dictionary and use concatenation to create the resulting string.
Python: Cypher Function Create a function that will take a phrase and either coded or decode the phrase (use only lowercase letters and spaces). 1. Name function "Cypher. py', with two inputs and one output. 2 The first input is a string to code or decode and the second input is an integer where 0 tells the function code and 1 tells it to decode the string. The one output is the converted string. Choose a cypher code and enter your cypher as a dictionary-ex, 3. { "a": "n" , } The code must include an alternate character for each of the 26 letters and a space. (Do not repeat any characters.) Create an equivalent d could be used to return the code into the original characters Loop through the characters in the phrase and find each letter in the dictionary and use concatenation to create the resulting string 4. e-cypher key and enter it as a de-cypher dictionary which 5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started