DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
invert a dictionary python
d = {'a':1, 'b':2, 'c':3} inverted_d = {} for k, v in d.items(): inverted_d[v] = k
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#invert
#dictionary
#python
ADD COMMENT
Topic
COMMENT
Name
6+3 =
Submit