tomer 发表于 2014-11-16 11:57

zip()函数


a=zip(("a","b","c"),(1,2,3))
print(a)
执行结果
<zip object at 0x01EA93C8>
书上说zip()函数返回一个元组列表。为什么运行结果不是呢

ssfjhh 发表于 2014-11-16 15:20

教程用的python2,却用的python3

tomer 发表于 2014-11-16 20:41

回复 2# ssfjhh


    是python是3版的。。。

tomer 发表于 2014-11-16 20:42

回复 2# ssfjhh


    教程也是3

ssfjhh 发表于 2014-11-17 15:13

回复 4# tomer


    哪本教程?发个链接过来看看。

tomer 发表于 2014-11-17 15:17

Python3程序开发指南.第二版

weiertzw 发表于 2014-11-18 16:32

list(a)

zip() in conjunction with the * operator can be used to unzip a list
页: [1]
查看完整版本: zip()函数