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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!