Open in TheBrain

Dictionary Python

<p>Feb 19, 2013 10:30 PM

&#160;

see Sean's program &#160;Plate Numbers... it uses

Numdict

&#160;

curly braces enclose {key1 : value1 , &#160;key2 : value2 , etc}

&#160;

so, eg &#160;Numdict[0] &#160;searches for key1 = 0 and returns the value corresponding to it.

&#160;

Famdict = {'father' : 'bob', 'son' : 'sean'}

&#160;

Famdict['son] &#160;returns 'sean'</p>