这不打印任何内容:
from itertools import combinations
comb = combinations([1,2], 3)
for i in comb:
print(i)
Run Code Online (Sandbox Code Playgroud)
我想输出为:
(1,2,2) (1,2,1) (1,1,2) (1,1,1) (2,1,2) (2,1,1) (2,2,1) (2,2,2)
Run Code Online (Sandbox Code Playgroud)