擅长:python、mysql、java
<p>我建议您使用字典,然后您可以使用<a href="http://docs.python.org/library/stdtypes.html#dict.update" rel="nofollow noreferrer"><strong>^{<cd1>}</strong></a>用一个字典中的键和值来更新另一个字典。你知道吗</p>
<p>请注意,Python中的字典没有排序。相反,当您需要迭代时,您可以获取它们的键,对它们进行排序,然后迭代这些键以获取相应的值。你知道吗</p>
<p>如果您使用的是python2.7、3.1或更高版本,那么您可能需要使用一个类<a href="http://docs.python.org/py3k/library/collections.html#collections.OrderedDict" rel="nofollow noreferrer"><strong>^{<cd2>}</strong></a>。你知道吗</p>