Categories
How to convert such a list to a dictionary?
Given a list in the following format: ["p=4", "d=5", "h=7"] How to convert it to a dictionary in the format: {"p": "4", "d": "5", "h": "7"}
Answer the question
In order to leave comments, you need to log in
dict(n.split('=') for n in arr)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question