Python 3.4 - Caesar Cipher
Caesar ciphers take a list of values and rotates through them to give them a different value. The program below takes from the alphabet and creates a cipher of the message. It returns many variations of the cipher then returns the actual message. import string import collections def caesar (rotate_string , number_to_rotate_by): upper = collections.deque(string.ascii_uppercase) lower = collections.deque(string.ascii_lowercase) upper.rotate(number_to_rotate_by) lower.rotate(number_to_rotate_by) upper = '' .join( list (upper)) lower = '' .join( list (lower)) return rotate_string.translate( str .maketrans(string.ascii_uppercase , upper)).translate( str .maketrans(string.ascii_lowercase , lower)) my_string = 'This is the message' my_string2 = caesar(my_string , 1 ) for i in range ( len (string.ascii_uppercase)): print (i , "|" , caesar(my_string2 , i)) /Users/mattfassnacht/PycharmProjects/untitled12/venv/bin/pyt...