all possible combinations generator python 2 list code example Example: python get all combinations of list itertools.combinations(iterable, r)