cartesian product in python code example Example: python list comprehension cartesian product [ (x, y) for x in xs for y in ys ]