Write another python program to decode the encoded message

Assignment Help Python Programming
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

Reference no: EM131325224

Questions Cloud

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?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd