回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我有一张单子</p>
<pre><code>L = Counter(mywords)
</code></pre>
<p>其中</p>
<pre><code>mywords = ['Well', 'Jim', 'opportunity', 'I', 'Governor', 'University', 'Denver', 'hospitality', 'There', 'lot', 'points', 'I', 'make', 'tonight', 'important', '20', 'years', 'ago', 'I', 'luckiest', 'man', 'earth', 'Michelle', 'agreed', 'marry', '(Laughter)', 'And', 'I', 'Sweetie', 'happy']
</code></pre>
<p>它比那要长得多,但那只是一个片段。</p>
<p>现在我接下来要做的是:</p>
<pre><code>print ("\n".join(c.most_common(10)))
</code></pre>
<p>因为我想让它显示列表中10个最常用的单词及其计数,但是我想让它为列表中的每一项打印成新行,而我得到的是这个错误:</p>
<pre><code>TypeError: sequence item 0: expected str instance, tuple found
</code></pre>
<p>使用Python 3,任何帮助都将不胜感激。</p>