Question: 4:28 PM cs.bu.edu IIAT&T 1. Write a function encipher (s, n) that takes as inputs an arbitrary string s and a non-negative integer n between
4:28 PM cs.bu.edu IIAT&T 1. Write a function encipher (s, n) that takes as inputs an arbitrary string s and a non-negative integer n between 0 and 25, and that returns a new string in which the letters in s have been "rotated" by n characters forward in the alphabet, wrapping around as needed For example >>> encipher ('hello', 1) ifmmp >>>encipher ('hello', 2) jgnng >>>encipher ('hello', 4) lipps Upper-case letters should be "rotated" to upper-case letters, even if you need to wrap around. For example >>>encipher ('XYZ', 3) ABC Lower-case letters should be "rotated" to lower-case letters >>>encipher ('xyz', 3) abc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
