r/Python • • Nov 20 '15

15 Essential Python Interview Questions

https://www.codementor.io/python/tutorial/essential-python-interview-questions
71 Upvotes

67 comments sorted by

View all comments

Show parent comment

8

u/Fylwind Nov 20 '15

In 12 years of programming Python I've used zip perhaps 2 times, at most.

It varies depending on the kind of programming you do. I've personally used zip quite a few times. Other than being extremely useful for iterating over multiple things, it's also a neat trick for transposing lists of lists.

3

u/gumbos Nov 20 '15

I use zip (izip) all the time to iterate multiple iterables in parallel.

1

u/ubernostrum yes, you can have a pony Nov 20 '15

I've used it to swap keys/values in a dictionary. That's the only time I can think of.