Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 300 Bytes

84.md

File metadata and controls

26 lines (22 loc) · 300 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