Note: I\'m working in python on this.
For example, given a list:
list = [\'a\',\'b\',\'c\',\'d\',\'e\',\'f\',\'g\',\'h\',\'i\',\'j\']
You should use the permutations function from the itertools
module.
>>> import itertools
>>> lst = ['a','b','c','d','e','f','g','h','i','j']
>>> itertools.permutations(lst, 3)
Or, if you really want to get combinations, then use the combinations function.
itertools.permutations(my_list, 3)
Assuming you're in python 2.6 or newer:
from itertools import permutations
for i in permutations(your_list, 3):
print i