Below is my code
import itertools a = [1,2,3] for i in itertools.combination_with_replacement(a,3): print i
Output
(1,
You want cartesian product, not combinations.
import itertools print list(itertools.product([1, 2, 3], repeat=3))