Dictionary attributes and functions

iddwb iddwb at imap1.asu.edu
Fri Mar 9 21:19:54 CET 2001

I'm looking to read a list of items where their may be duplicates.  I'd
like to use a dictionary to do this but am way to new to python to know
fully how to do it.  I'm hoping there is some set of fuctions or
attributes that can be reference regarding dictionaries... specifically if
key(a) is already in dictionsary x I'd like to know prior to
adding.  rather than change the value of key(a) I'd like to add the value
of key(`a) to the value of key(a) so I end up with

{keya: [123]}
on insert of keya againg have something like
{keya: [123, 234]}

Any pointers on what to look for in the docs?

btw, I've been going through Mark Lutz's book on "programming python" but
I'd like something with a little more langugage reference in it.

David Bear
College of Public Programs/ASU

More information about the Python-list mailing list