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\
Another way:
>>> l = ["a", 1, "b", 2, "c", 3] >>> dict([l[i:i+2] for i in range(0,len(l),2)]) {'a': 1, 'c': 3, 'b': 2}