Question
Program 5: Caesar Cipher This problem builds on the Caesar Cipher program from a previous lab. If you didnt get to that part of the
Program 5: Caesar Cipher This problem builds on the Caesar Cipher program from a previous lab. If you didnt get to that part of the lab, heres some code that starts with a word, Minneapolis and shifts each letter by 6 letters to produce a coded word. word = "Minneapolis" shift = 6 coded_word = "" for letter in word: coded_letter = chr(ord(letter) + shift) coded_word = coded_word + coded_letter print(word + " in code is " + coded_word) Please write a function that takes a string (a word) and a number (the number of letters to shift) as arguments. The function should shift each letter by the number given; and return the coded word. Or, your function can take a sentence and a number as an argument, and return a coded sentence. Now, can you write a decoding function? This function will take a coded string and a number as arguments. Final version: write an encrypting/decrypting program. Ask the user if they want to encrypt or decrypt, and call the appropriate function. What if the user has lots of strings to encrypt and decrypt? Perhaps you could use a while true loop so the program repeats until the user wants to quit? Using python.
Step 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