Search
 
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
Name
5+5 =