- >>> 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')]
- #该片段来自于http://www.codesnippet.cn/detail/110120131559.html
来源: http://www.codesnippet.cn/detail/110120131559.html