相关疑难解决方法(0)

检查两个无序列表是否相等

我正在寻找一种简单(快速)的方法来确定两个无序列表是否包含相同的元素:

例如:

['one', 'two', 'three'] == ['one', 'two', 'three'] :  true
['one', 'two', 'three'] == ['one', 'three', 'two'] :  true
['one', 'two', 'three'] == ['one', 'two', 'three', 'three'] :  false
['one', 'two', 'three'] == ['one', 'two', 'three', 'four'] :  false
['one', 'two', 'three'] == ['one', 'two', 'four'] :  false
['one', 'two', 'three'] == ['one'] :  false
Run Code Online (Sandbox Code Playgroud)

我希望不使用地图就能做到这一点.

python comparison list

234
推荐指数
5
解决办法
31万
查看次数

标签 统计

comparison ×1

list ×1

python ×1