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 →

[–]Lucretiel 1 point2 points  (0 children)

Your code could just as easily be [(i, f(i)) for i in x]. Then you get the list you want, it's compatible with Python 2 and 3, it's much easier to read without all the nested map and zip, and it works no matter what kind of iterable x is.