經過多個list循環

 

a = [1,2,3,4]ip

b = [9,8,7]map

1.map()

map(None, a, b)   => [(1,9), (2,8), (3,7), (4, None)]

2.zip()

zip(a,b)   =>[(1,9), (2,8), (3,7)]

3.[]

[(x,y) for x in a for y in b]

相關文章
相關標籤/搜索