题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
key = input().strip() target = input().strip() alphabet = [chr(x) for x in range(97, 123)] keyalphabet = [] result = '' for k in key: if k not in keyalphabet: keyalphabet.append(k) for s in alphabet: if s not in keyalphabet: keyalphabet.append(s) for t in target: result += keyalphabet[alphabet.index(t)] print(result)