First time here? Check out the FAQ!
answered 2019-01-02 23:18:26 +0100
You can use product provided by the itertools Python module:
product
itertools
sage: list(product([0,1,2], repeat=2)) [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]