Python dictionary creation syntax

You could turn it around:

>>> d1 = {"yes": [1,2,3], "no": [4]}

and then "invert" that dictionary:

>>> d2 = {value:key for key in d1 for value in d1[key]}
>>> d2
{1: 'yes', 2: 'yes', 3: 'yes', 4: 'no'}

How about:

501 $ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {"q":1}
>>> print a
{'q': 1}
>>> a["q"]
1
>>> a["r"] = a["s"] = a["t"] = 2
>>> a
{'q': 1, 's': 2, 'r': 2, 't': 2}
>>>