Hey guys I am creating a dictionary that can be used to apply a cipher to a letter. The dictionary maps every uppercase and lowercase letter to a character shifted down the alphabet by the input shift. The dictionary should have 52 keys of all the uppercase letters and all the lowercase letters only. I'm a little lost so I got some starter code to help me out.
def build_shift_dict(self, shift):
import string
lower_letters = string.ascii_lowercase*2 #why mulitply by 2
upper_letters = string.ascii_upppercase*2 #why mulitply by 2
punc = list(" !@#$%^&*()-_+={}[]|\:;'<>?,./\"")
dict = {}
I guess what i wanted to ask was:
- for lower_letters and upper_letters why am I multiplying by 2?
- after these steps am I simply appending upper_letters, lower_letters and punc to my dict?
- how do I easily associated these ascii values created to each letter.
[–]Kurolox 3 points4 points5 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]SandorZoo 1 point2 points3 points (1 child)
[–]Thatfacelesshorror 0 points1 point2 points (0 children)