Peng Yu wrote: > I'm wondering if there is something similar to list comprehension for > dict (please see the example code below). Python 3 has list, set, and dict comprehensions. Don't know about 2.6/7