iterating over 2 iterators - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: iterating over 2 iterators (/thread-18943.html) |
iterating over 2 iterators - Skaperen - Jun-07-2019 what was the name of that function that would iterate over 2 iterators and let you do: for x,y in iter2(xx,yy):where xx and yy are 2 iterators of presumably the same length (else the iteration stops at the end of the shorter iterator). RE: iterating over 2 iterators - Yoriz - Jun-07-2019 https://docs.python.org/3/library/functions.html#zip Wrote:zip(*iterables) RE: iterating over 2 iterators - Skaperen - Jun-07-2019 thanks! that is the function i was looking for. i did remember it had an odd name but i was unable to come up with the right words to find it in the document or on google ("iterators" brings lots of noise). |