I\'m trying to display all possible permutations of a list of numbers, for example if I have 334 I want to get:
3 3 4
3 4 3
4 3 3
I need to
You want permutations, not combinations. See: How to generate all permutations of a list in Python
>>> from itertools import permutations
>>> [a for a in permutations([3,3,4])]
[(3, 3, 4), (3, 4, 3), (3, 3, 4), (3, 4, 3), (4, 3, 3), (4, 3, 3)]
Note that it's permuting the two 3's (which is the correct thing mathematically to do), but isn't the same as your example. This will only make a difference if there are duplicated numbers in your list.