题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
l=input() key="" s2="" s1=input() for i in l: if i not in key: key=key+i for i in range(97,123): if chr(i) not in key: key=key+chr(i) for i in s1: m=i.lower() a=int(ord(m)-97) if i==m: s2=s2+key[a] else: s2=s2+key[a].upper() print(s2)