18.11.2014 Views

Zelle - Chapter 11.pdf - CTools

Zelle - Chapter 11.pdf - CTools

Zelle - Chapter 11.pdf - CTools

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dictionaries are not Ordered<br />

>>> dc = { "a" : 123, "b" : 400, "c" : 50 }<br />

>>> print dc<br />

{'a': 123, 'c': 50, 'b': 400}<br />

Dictionaries have no order<br />

and cannot be sorted. Lists<br />

have order and can be<br />

sorted.<br />

>>> dc = dict()<br />

>>> dc.append("one")<br />

>>> dc.append("and")<br />

>>> dc.append("two")<br />

>>> print lst<br />

['one', 'and', 'two']<br />

>>> lst.sort()<br />

>>> print lst<br />

['and', 'one', 'two']<br />

>>><br />

http://en.wikipedia.org/wiki/Hash_function

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!