python zip

#!/usr/local/env python2
  >>> x = [1,2]
  >>> y = [5,6]
  >>> xy = zip(x,y)
  >>> type(xy)
    <type 'list'>
  >>> print xy
    [(1, 5), (2, 6)]
  >>> print dict(xy)
    {1: 5, 2: 6}

原文地址:https://www.cnblogs.com/m3345/p/5130009.html