Question
The Caesar cipher main function: shift, and writing a for loop Write a cencrypt() function that takes a arbitrary length string and an integer as
The Caesar cipher main function: shift, and writing a for loop
Write a cencrypt() function that takes a arbitrary length string and an integer as inputs and returns a string as output.
The cencrypt() function you write needs to work on strings that contain upper-case letters, lower-case letters, or both. The output string should be all upper-case letters. (The Romans of Caesar's time used only what today we call upper-case letters.)
So a call to cencrypt("Caesar", 1) should return (return not print) the string DBFTBS and a call to cencrypt(DBFTBS, -1)should return the string "CAESAR".
You may not use either of the Python functions ord() or chr() for this.
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