【发布时间】:2021-04-25 02:04:22
【问题描述】:
我找到了一些解决方案,但没有一个是我需要的。
例如:
list1 = ['a', 'b', 'c']
list2 = ['a', 'a', 'b', 'c']
Counter(list1) == Counter(list2) -> True,但我需要 False 因为双 'a' ////
set(list1) == set(list2) -> True,但我还需要False。
我想编写一个小代码来从列表中搜索可能的单词。
示例:
wordCollection = ["dog", "go", "home", "long"] //// 输入字符:“NLGUCOBAD”
结果:狗,走,长
【问题讨论】:
标签: python list function collections counter