Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions