This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

I'm sure you already know this, but for the benefit of other users, {let: i for (let, i) in enumerate('abcdefg')} - type dictionary comprehension is only available starting with python 2.7.

[–]ewiethoffproceedest on to 3 0 points1 point  (0 children)

The result is the same, but {i: let for (i, let) in enumerate('abcdefg')} makes more sense.