试试这个
import itertools L = ['a','b','c'] P = list( itertools.product(L, repeat=3) ) [ [(x,1),(y,2),(z,3)] for x,y,z in P ]