题解 | #字符串加密#

字符串加密

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

import sys

key = input()
password=input()
wordstr="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"
wordlist=wordstr.split(" ")
wordlist=[chr(ord(it)-ord('A')+ord('a')) for it in wordlist]
new_wordlist=[]
for it in key:
    if it not in new_wordlist:
        new_wordlist.append(it)
for it in wordlist:
    if it not in new_wordlist:
        new_wordlist.append(it)
result=[]
for it in password:
        result.append(new_wordlist[ord(it)-ord('a')])
print(''.join(result))

全部评论

相关推荐

挣K存W养DOG:他真的很中意你,为什么不回他
点赞 评论 收藏
分享
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务