Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

turn dictionary into flat list

>>> [item for pair in d.iteritems() for item in pair]
['a', 1, 'c', 3, 'b', 2]
>>> [item for pair in d.viewitems() for item in pair]
['a', 1, 'c', 3, 'b', 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #turn #dictionary #flat #list
ADD COMMENT
Topic
Name
9+1 =