In <[email protected]> Wanderer 
<[email protected]> writes:

> I guess two keys having the same value is why dictionaries don't
> return keys for values, but this is a code. Each value has a unique
> meaning to both sender and receiver. The text part is for making the
> program understandable and printing understandable error messages.

I see.  You're storing integer equivalents for the labels themselves,
not the actual data associated with the labels.

Then Mel's solution is a good one -- construct a second dict which
has the keys and values swapped.

-- 
John Gordon                   A is for Amy, who fell down the stairs
[email protected]              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to