Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 371 Bytes

84.md

File metadata and controls

28 lines (23 loc) · 371 Bytes
@author jackzhenguo
@desc 
@date 2019/5/4

84 chain串联小容器为大容器

chain函数串联a和b,兼顾内存效率同时写法更加优雅。

from itertools import chain
a = [1,3,5,0]
b = (2,4,6)

for i in chain(a,b):
  print(i)
### 结果
1
3
5
0
2
4
6
[上一个例子](83.md) [下一个例子](85.md)