题解 | #字符串加密#

字符串加密

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

'''nihao ABCDEFGHIJKLMNOPQRSTUVWXYZ NIHAOBCDEFGJKLMPQRSTUVWXYZ ''' while True: try: source = input() example = input() L1 = 'abcdefghijklmnopqrstuvwxyz' L2 = [] for i in range(len(source)): #去重 if source[i] not in L2: L2.append(source[i]) else: continue L3 = L2 + [sentence for sentence in L1 if not any(word in sentence for word in L2)] #去除L1中包含的L2的字符,拼接生成新的列表 for i in example: print(L3[L1.index(i)], end = '') except: break

全部评论

相关推荐

野猪不是猪🐗:我assume that你must技术aspect是solid的,temperament也挺good的,however面试不太serious,generally会feel style上不够sharp
点赞 评论 收藏
分享
米黑子米黑子:你这个成绩不争取下保研?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务