Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. from string import ascii_lowercase as alphabet
  2.  
  3. code_string = input().lower()
  4. code_key = input()
  5. # table = str.maketrans(code_key, alphabet)
  6. # print(code_string.translate(table))
  7. decode_string = ''
  8. for sign in code_string:
  9.     if sign in code_key:
  10.         idx = code_key.index(sign)
  11.         decode_string += alphabet[idx]
  12.     else:
  13.         decode_string += sign
  14.  
  15. print(decode_string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement