Return to Snippet

Revision: 37349
at December 8, 2010 21:00 by Voil

Initial Code
dict = {'a': 1, 'b': 2, 'c': 3}
print({value:key for key, value in dict.items()})
# Prints: {1: 'a', 2: 'b', 3: 'c'}

Initial URL

Initial Description
Based on the example by [Mark Pilgrim](

Initial Title
Swapping keys and values of a dictionary

Initial Tags

Initial Language