If your products are not too big you may use the following approach def cross(*L): P=[()] for i in range(len(L)): P_=[] for p in P: for el in L[i]: P_.append(p+(el,)) P = P_ return P if __name__ == '__main__': for x in cross((0,1,2), (0,1), (0,1)): print x