Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Caesar Cipher for Shika (which actually looks good)

a guest Nov 15th, 2018 91 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import string
  2.  
  3. alph_val = dict(zip(range(1,27), string.ascii_uppercase))
  4. alph_key = dict(zip(string.ascii_uppercase, range(1,27)))
  5.  
  6. plaintext = str(input("Enter plain text : ")).upper()
  7. shift = int(input("Enter desired shift : "))
  8.  
  9. s_pt = plaintext.split(' ')
  10.  
  11. words_list = []
  12. for i in range(len(s_pt)):
  13.     word_list = ''
  14.     for letter in s_pt[i]:
  15.         n_letternum = shift + alph_key[letter]
  16.        
  17.         if (n_letternum > 26):
  18.             n_letternum -= 26
  19.            
  20.         n_letter = alph_val[n_letternum]
  21.         word_list += n_letter
  22.        
  23.     words_list.append(word_list)
  24.  
  25. print("Cipher Text : ", *words_list)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top