题解 | 字符串加密

字符串加密

https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3

import sys
import string
a= input()
b = input()
ad = set()
na = ""
for _ in a:
    if _ not in ad:
        ad.add(_)
        na+=_
all_s = string.ascii_lowercase
for _ in all_s:
    if _ not in ad:
        na+=_
ma = {}
for i in range(len(all_s)):
    ma[all_s[i]]=na[i]
res=""
for _ in b:
    res+=ma[_]
print(res)

python的string.ascii_lowercase 挺好用的

全部评论

相关推荐

迷茫的大四🐶:干脆大厂搞个收费培训得了,这样就人均大厂了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务