zip可以对元组进行元素对应重组,返回一个新的元组数组
>>> print zip( ['a','b','c'], [1,2,3] ) [('a', 1), ('b', 2), ('c', 3)] >>> print zip( ['a','b','c'], [1,2,3], ['U','V','W'] ) [('a', 1, 'U'), ('b', 2, 'V'), ('c', 3, 'W')] >>> print zip('abcd','1234') [('a', '1'), ('b', '2'), ('c', '3'), ('d', '4')] >>> print zip( [1,2,3,4,5], ['a','b'] ) [(1, 'a'), (2, 'b')]