擅长:python、mysql、java
<blockquote>
<p>It is best to think of a dictionary as an <strong>unordered set</strong> of key: value pairs, with the requirement that the keys are unique (within one dictionary).</p>
</blockquote>
<p><a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries" rel="nofollow noreferrer">docs.python.org</a>,我的</p>
<p>但是,您可以将<code>dict</code>转换为<code>tuple</code>并对其进行排序:</p>
<pre><code>my_sorted_tuple = sorted(my_dict.items())
</code></pre>