Question:
In Python, which built-in function returns an iterator that aggregates elements from two or more iterables in parallel tuples?
पायथन में कौन सा अंतर्निहित फ़ंक्शन एक इटरेटर लौटाता है जो दो या अधिक पुनरावृत्तियों से तत्वों को समानांतर टुपल्स में एकत्रित करता है?
Options:
zip()enumerate()map()filter()
zip()enumerate()map()filter()
Correct Answer: a)
Explanation:
The
zip() function takes multiple iterables and yields tuples containing corresponding elements until the shortest input is exhausted (e.g. zip([1,2], ['a','b']) -> (1, 'a'), (2, 'b')).
पायथन का
zip() फंक्शन कई इटरेबल्स के संगत तत्वों को एक साथ टुपल्स में जोड़कर एक इटरेटर लौटाता है।