DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python tuple to dict
>>> t = ((1, 'a'),(2, 'b')) >>> dict((y, x) for x, y in t) {'a': 1, 'b': 2}
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#tuple
#dict
ADD COMMENT
Topic
COMMENT
Name
8+4 =
Submit