我有一個元組列表mylist = [(100, 'Unknown'), ('Unknown Player', 'BBB'), (20, 90), (40, 'DDD')]我想返回包含該單詞的元組列表Unknown我試過:matches = [x for x in mylist if 'Unknown' in x]但這會返回:(100,'Unknown)我想返回:[(100, 'Unknown'), ('Unknown Player', 'BBB')]
如何在元組列表中查找部分字符串匹配
料青山看我應(yīng)如是
2023-10-18 16:18:00