题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
str1=input() str_test=input() str2='' str3=[] k=0 for i in str1: if i not in str2: str2=str2+i #删除重复元素 normal_str='abcdefghijklmnopqrstuvwxyz' for i in normal_str: if i not in str2: str2=str2+i for j in str_test: num=list(normal_str).index(j) str3.append(str2[num]) for i in str3: print(i,end='')