题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
key = input()
plaintext = input()
##"ABCDEFGHIJKLNOPQRSTUVWXYZ"
alphabet = "abcdefghijklmnopqrstuvwxyz"
key2 = ''
password = ''
for i in key:
if i not in key2:
key2 = key2 + i
for i in alphabet:
if i not in key2:
key2 = key2 + i
for j in plaintext:
ind = alphabet.index(j)
password += key2[ind]
print(password)
