is hash map data structure available in Python?
7stud
bbxx789_05ss at yahoo.com
Wed Mar 19 20:01:39 EDT 2008
On Mar 19, 2:40 am, grbgooglefan <ganeshbo... at gmail.com> wrote:
> Hi,
> I have a situation that I need to search a name in a big list of names
> in my Python embedded interpreter. I am planning to use hash map for
> quicker search.
> How do I create hash map in Python?
> Can you please guide me to some documentation or tutorial which
> provides information on creating, editing, searching through hash map
> in Python?
> Thanks.
#creating:
my_dict = {'a':1, 'b':2, 'c':3}
#editing:
my_dict['a'] = 10
#searching:
result = my_dict.get('a', None)
print result //10
result = my_dict.get('f', None)
print result //None
More information about the Python-list
mailing list