I have a list of strings parsed from somewhere, in the following format:
[key1, value1, key2, value2, key3, value3, ...]
I'd like to create a dictionary based on this list, like so:
{key1:value1, key2:value2, key3:value3, ...}
An ordinary for
loop with index offsets would probably do the trick, but I wonder if there's a Pythonic way of doing this. List comprehensions seem interesting, but I can't seem to find out how to apply them to this particular problem.
Any ideas?