4 ms·
Question, how do you over multiple long lists (in python 2) especially if zip itself takes a long time to zip them, for example.
by noobermin 12y ago
Question, how do you over multiple long lists (in python 2) especially if zip itself takes a long time to zip them, for example.
- takeda 12y agoYou use Python 3. J/K, while this is technically a limitation of Python 2, there actually is izip in itertools package which is a generator and works in similar way to zip in python 3.
- noobermin 12y agoAwesome! I knew there was some lazy zip-ish thing for python 2. I personally hate using range(len(foo)) as anyone else.
- jimmaswell 12y agoYou just use a for i in range(len(... and ignore this web article's opinion on it since the situation calls for it