from itertools import combinations_with_replacement as cm import operator import functools prodlist = [] x = [3,4,2,6,7] for i in cm(x, 3): prod = functools.reduce(operator.mul, i, 1) print 'Product of',i,'is', prod prodlist.append(prod) print max(prodlist) Output: Product of (3, 3, 3) is 27 Product of (3, 3, 4) is 36 Product of (3, 3, 2) is 18 Product of (3, 3, 6) is 54 Product of (3, 3, 7) is 63 Product of (3, 4, 4) is 48 Product of (3, 4, 2) is 24 Product of (3, 4, 6) is 72 Product of (3,...