问题 This question already has answers here : Get the cartesian product of a series of lists? (13 answers) Closed 3 years ago . For example, list = [0, 1, 2] I want a list of all possible 2-combinations: combinations = [(0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2)] It seems to me that all the tools in itertools in Python only make one of (1,0) and (0,1), not both, I need both. Any suggestions, other than entering them by hand? 回答1: You are looking for a Cartesian product of that