A nested loop places one loop inside another. For each outer-loop iteration, the inner loop completes all its iterations before the outer loop advances. section 5.1.2
Nested loops commonly process two-dimensional data arranged as rows and columns. In Python, a list of lists can represent that structure, with indexes selecting a row and then a column. section 5.1.2
Pairing every country
With countries set to Canada, USA, and Japan, the inner loop prints Canada Canada, Canada USA, and Canada Japan before the outer loop proceeds to USA. The complete output contains every ordered pair.


