擅长:python、mysql、java
<p>Rahul是正确的;字典列表并不是正确的方法。想象一下:字典是数据块之间的映射。最后一个例子<code>courses</code>是存储数据的正确方法;然后可以执行以下操作来存储每个用户的数据:</p>
<pre><code>courses = {
1456: 'History',
316: 'Science',
926: 'Geography'
} # Note the lack of quotes
test_scores = {
1456: { <user-id>: <score on History test> },
316: { <user-id>: <score on History test> },
926: { <user-id>: <score on History test> }
}
</code></pre>