Convert list into a dictionary

Viewed 433523
l = ["a", "b", "c", "d", "e"]

I want to convert this list to a dictionary like:

d = {"a": "b", "c": "d", "e": ""}

So basically, the evens will be keys whereas the odds will be values. I know that I can do it in a "non-pythonic" way such as a for loop with if statements but I believe that there should be a more "pythonic" way to accomplish this. So, I appreciate any help :)

4 Answers
Related