In <7546e476-d10f-46e5-8b20-5d9b42345...@r6g2000vbo.googlegroups.com> Wanderer 
<wande...@dialup4less.com> 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
gor...@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

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

Reply via email to