擅长:python、mysql、java
<p>可以在集合中使用无序的哈希数据结构。<code>frozenset()</code>是你的朋友吗</p>
<pre><code>In [7]: {frozenset(i) for i in your_list}
Out[7]:
{frozenset({'generator', 'generators'}),
frozenset({'game', 'games'}),
frozenset({'challenge', 'challenges'})}
</code></pre>
<p>请注意,为了避免在列表上循环,最好在创建列表时首先这样做。你知道吗</p>