示例如下:
In [5]: [(i,j) for i in range(10) for j in range(2) ]
Out[5]:
[(0, 0),
(0, 1),
(1, 0),
(1, 1),
(2, 0),
(2, 1),
(3, 0),
(3, 1),
(4, 0),
(4, 1),
(5, 0),
(5, 1),
(6, 0),
(6, 1),
(7, 0),
(7, 1),
(8, 0),
(8, 1),
(9, 0),
(9, 1)]
for i in range(10)可以看作是一个外循环,for j in range(2)看作是一个内循环