質問: [s for s in list if "e" in s] print(list2) # 出力 # ["eee"] ```
回答: 正規表現を使います。 ``` >>> import re >>> list1 = ["eee", "aaa", "こんにちは", "こんばんは"] >>> list2 = [s for s in list1 if re.search(r'[aioeo]', s) != None] >>> print(list2) ['eee', 'aaa'] ```