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