Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
create 2d list dictionary
Arnaud
Programming language:
Python
2021-06-23 03:11:59
0
Q:
create 2d list dictionary
Long Pham
Code:
Python
2021-07-12 04:30:09
d = {} for elem in l: if elem[
1
] in d: d[elem[
1
]].append(elem[
0
]) else: d[elem[
1
]] = [elem[
0
]]
1
Tags
list
create
dict
Related
python sort a 2d array by custom function
join two numpy 2d array
how to create 2d list in python
converge 2 list to form 2d list in python
python initialize a 2d array
create dictionary python from two lists
python copy a 2D list
how to generate 2d list in python of all same value
initialise a 2d array python
python how to change an element in a multi dimensional list
how to address a column in a 2d array python
python print 2d array as table
python order 2d array by secode element
how to transpose a 2d list in python
2d list comprehension python
New to Communities?
Join the community