KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here's how I'm currently converting a list of tuples to dictionary in Python: l = [('a',1),('b',2)] h = {} [h.update({k:v}) for k,v in l] > [None, None] h > {'a': 1, 'b': 2} Is there a better way? It seems like there should be a one-liner to do this.
Tags (comma-separated)
Save Edits
Cancel