Map list onto dictionary June 10, 2023 by Tarik In Python 3 you can use this dictionary comprehension syntax: def foo(somelist): return {x[0]:x for x in somelist}