python derivation for a plurality of cycles

Examples are as follows:

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) can be seen as an outer loop, for J in Range (2) regarded as a circular inner

Guess you like

Origin www.cnblogs.com/qianxunman/p/12526442.html