Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def encrypter(text, key):
- alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ., '
- ciphered_text = ''
- for i in range(len(text)):
- t_numeric_val = alph.index(text[i])
- k_numeric_val = alph.index(key[i])
- c_numeric_val = (t_numeric_val + k_numeric_val) % 29
- ciphered_text += alph[c_numeric_val]
- ## print(text[i],t_numeric_val,key[i], k_numeric_val, ciphered_text)
- return ciphered_text
- print(encrypter("ONE IF BY LAND, TWO IF BY SEA.", "THE CELERY STALKS AT MIDNIGHT."))
- ## EUI,KJKFMXKSDDJJIVOSHRHEIHYLTX
- ##def decrypter(text):
- ## for i
Advertisement
Add Comment
Please, Sign In to add comment