擅长:python、mysql、java
<p>这并不漂亮,但您可以执行“double”<code>sorted()</code>,首先是<code>list2</code>值,然后是反向的<code>list1</code>值:</p>
<pre><code>from operator import itemgetter
list1=[3,4,2,1,6,1,4,9,3,5,8]
list2=['zombie','agatha','young','old','later','world',
'corona','nation','domain','issue','happy']
srt=sorted(sorted(zip(list1,list2), key=itemgetter(1)), key=itemgetter(0), reverse=True)
print(srt)
</code></pre>
<p>输出:</p>
<pre><code>[(9, 'nation'), (8, 'happy'), (6, 'later'), (5, 'issue'), (4, 'agatha'), (4, 'corona'), (3, 'domain'), (3, 'zombie'), (2, 'young'), (1, 'old'), (1, 'world')]
</code></pre>