itertools in the python standard library has what you need >>> import itertools >>> list( itertools.product([4,5], [7,8,9]) ) [(4, 7), (4, 8), (4, 9), (5, 7), (5, 8), (5, 9)] (all the itertools functions return generators, so the list() is to convert it to a list) Sam