Dictionary Methods
eharetea

Basic dictionary methods.

Python dictionaries!

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Friday August 01st, 2008 01:29 AM

D.values()
D.keys()
D.items()
D.get('key')
D.update(D2)
D.has_key('key')
len(D)
del D['key']



>>> D = {'one':1,'two':2, 'three':3}
>>> D.values()
[3, 2, 1]
>>> D.keys()
['three', 'two', 'one']
>>> D
{'three': 3, 'two': 2, 'one': 1}