python技巧(11)

来源:互联网 发布:java课程设计案例源码 编辑:程序博客网 时间:2024/06/05 17:09

在一个for语句中迭代多个可迭代对象
1.并行:tuple=zip(mathlist,englishlist,chaineselist)
for x in tuple:
print x
2.串行:itertools下的chain
s=chain(mathlist1,mathlist2,mathlist3)
for x in s:
if x>90:
print x

0 0
原创粉丝点击