'''
This program encrypts uppercase characters by shifting them two the right. A becomes C, B becomes D, etc.
Note the use of modulo to handle the end of the alphabet, i.e., Y becomes A, Z becomes B
'''
import string
# number of characters to shift over
shift = 2
# print the string being encrypted
print(string.ascii_uppercase)
# print each shifted character
for letter in string.ascii_uppercase:
print(chr((ord(letter) - 65 + shift) % 26 + 65), end='')
Why have we subtracted 65 from the ordinal value of each character?
Why have used modulo 26?
Modify the program above to work exclusively with lowercase letters.
Modify the program(s) above to work with both upper- and lowercase letters.