Reference no: EM131325224
Write a Python program to encode the plain text message and another Python program to decode the encoded message.
Use the following as starter code:
# <Put your name here> # HW 5 Caesar Cipher: Encoder # Do not modify next 8 lines def encode(): print("Caesar cipher") print() # chars is given for your convenience. It will help for # an easier solution. You do not have to use it. chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz" # Fill in the expression to ask for the key value: key = # Fill in the expression to ask for the phrase to encode: plain = # Your main code starts here. Use as many lines as needed. # Do not modify any lines below print("Encoded message follows:") print(cipher) encode()
Be aware that chars is a long string having 53 characters in it. There is only one space between letters `Z' and `a' in it.
You must use an accumulator variable for the encoded message.
You may also want to use a for loop, the remainder operator, the string find() function to find the location of a letter from chars, string indexing and the len() function.
You are not allowed to use any other Python modules or functions that have not been discussed in class nor in the book.
Show the result using the message "The quick brown fox Alice jumps over the lazy dog Zoro" in a Jupyter Notebook cell.
2. Write another Python program to decode the encoded message according to the "circular Caesar cipher" problem presented in Programming Exercises 7 and 8 of Book Chapter 5.
Use the following as starter code:
# <Put your name here> # HW 5 Caesar Cipher: Decoder # Do not modify next 8 lines def decode(): print("Caesar cipher") print() # chars is given for your convenience. It will help for # an easier solution. You do not have to use it. chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz" # Fill in the expression to ask for the key value: key = # Fill in the expression to ask for the phrase to decode: plain = # Your main code starts here. Use as many lines as needed. # Do not modify any lines below print("Decoded message follows:") print(cipher) decode()
Use the same guidelines as given in the previous question.
Show the result using the encoded message from "The quick brown fox Alice jumps over the lazy dog Zoro" in a Jupyter Notebook cell.
Attachment:- Attachments.rar
How would speculation be undertaken using the spot market
: Are the quotations given direct or indirect Copenhagen quotations?- How would the speculation be undertaken using the spot market only?
|
How has modern technology impacted peoples views on ethics
: Looking at the impact of technology (computers, the Internet, smartphones, etc.) on American society, how has modern technology impacted people's views on ethics?
|
Write a page summary of your conversation with jim
: Imagine you work at a company and it is time for an employee named Jim's annual review. While he was a model employee the first nine (9) months of the year, recently Jim has been coming in late. It has not been just a few minutes each day, either...
|
Calculate the outright quotes for one and six months forward
: Calculate the outright quotes for one, three and six months forward.- If the treasurer wished to buy Ruritanian doppels three months forward, how much would he or she pay in dollars?
|
Write another python program to decode the encoded message
: Write another Python program to decode the encoded message according to the "circular Caesar cipher" problem presented in Programming Exercises 7 and 8 of Book Chapter 5.
|
Describe historical events or factors
: Briefly describe systems theory and the advent of systems thinking. Describe historical events or factors that have influenced systems thinking. Discuss how these historical factors have influenced: a) society, b) human resources, and c) you as an in..
|
Why is harrison bergeron particularly threatening
: Why is Harrison Bergeron particularly threatening to those in power in his society - It's possible that Garcia-Marquez have intended the Old Man with Enormous Wings to actually be an angel? If so, what point is he making about the villagers, and, u..
|
What is an example of a recent creative sourcing strategy
: What is an example of a recent creative sourcing strategy used by a company and how successful was it?Share other sourcing strategies you personally think are creative,Please describe them,Share why you think they are creative.
|
What is the relationship between beauty
: By contrast, Plato (in The Republic) warns of poetry's power to make a falsehood seem true, by beautifying it. What, then, is the relationship between beauty, as achieved by the artist, and truth?
|