integers = [1, 2, 3]pairs = [(i, j) for i in integers for j in integers] print( pairs )
Standard input is empty
[(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!