题解 | #字符串加密#
字符串加密
http://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
word = input() secret = input() word_list = 'abcdefghijklmnopqrstuvwxyz' new_word = [] for i in word: if i not in new_word: new_word.append(i) str_list = word_list for i in new_word: str_list = str_list.replace(i, '') str_list = ''.join(new_word) + str_list new_str = '' for i in range(len(secret)): new_str += list(str_list)[(word_list).index(secret[i])] print(new_str)