擅长:python、mysql、java
<p>假设我们有一个<code>int</code>的列表:</p>
<p>我们可以用听写理解</p>
<pre><code>>>> l = [3, 2, 4, 5, 7, 9, 0, 9]
>>> d = {"item" + str(k): l[k] for k in range(len(l))}
>>> d
{'item5': 9, 'item4': 7, 'item7': 9, 'item6': 0, 'item1': 2, 'item0': 3, 'item3': 5, 'item2': 4}
</code></pre>