I have a list of values like:
[\"a\", 1, \"b\", 2, \"c\", 3]
and I would like to build such a dict from it:
{\"a\": 1, \"b\
You can zip the lists of alternate elements like so
zip
>>> lst = ["a", 1, "b", 2, "c", 3] >>> dict(zip(lst[::2], lst[1::2]) {'a': 1, 'c': 3, 'b': 2}