例如,以下所有内容都应返回[(2,2)],因为返回的列表中的所有元组元素在值方面都是相同的。
>>> list(combinations([2,2,2],2))
[(2, 2), (2, 2), (2, 2)]
>>> list(combinations_with_replacement([2,2],2))
[(2, 2), (2, 2), (2, 2)]
>>> list(combinations_with_replacement([2,2,2],2))
[(2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)]
>>> list(combinations([i,i,i],2))
[(2, 2), (2, 2), (2, 2)]