DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
create 2d list dictionary
d = {} for elem in l: if elem[1] in d: d[elem[1]].append(elem[0]) else: d[elem[1]] = [elem[0]]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#create
#list
#dictionary
ADD COMMENT
Topic
COMMENT
Name
6+3 =
Submit