题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
while True: try: key = input().strip() val = input().strip() dic = dict() alph = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.lower().split(' ') temp = [] res = '' for i in key: if i in temp: continue else: temp.append(i) # table = [] for i in alph: if i in temp: continue else: temp.append(i) dic = dict(zip(alph,temp)) for i in val: res += dic.get(i) print(res) except: break