アルファベットの重複がない単語を抽出する方法 2022年5月18日 / 1 min read View more blogs with the tag python Table of Contents #はじめに #方法 はじめに アルファベットの重複がない単語を抽出する方法です。 方法 words = ['about', 'is', 'cat', 'skill', 'test'] word_list = []for word in words: alp_dic = {} for char in word: alp_dic[char] = alp_dic.get(char, 0) + 1 if max(alp_dic.values()) == 1: word_list.append(word) # output: word\_list = ['about', 'is', 'cat']