[Tutor] [Tutor]: Totally laughable basic questions

Pijus Virketis virketis@fas.harvard.edu
Tue, 15 Jan 2002 14:41:09 -0500


> A LIST is rather like a 1 dimensional array. You can change the
> contents of a list, even append new cells.
>
> A DICTIONARY is rather like 2 lists in one, where there is a KEY and a
> CONTENT.

One very important difference between a list and a dictionary is that a
dictionary is not ordered! In other words, it stores the content, but not
the structure of the content. Because of that, a dictionary is a "faster"
data structure, but a list is sometimes more useful. Of course, if a bit of
extra work, you can pretty much use a dictionary in most places you would
use a list, by iterating over the key list (which is a list, and hence can
be iterated over :)).

Cheers,

Pijus