def list_all(operations, values):
    if len(values) == 1:
        return values
permutes = []
ops = []
expressions = []
for subset in range(2, len(values) + 1):
    permutes.append(list(permutations(values, subset)))
ops.append(list(combinations_with_replacement(operations, subset - 1)))
for o, v in zip(ops, permutes):
    expressions.append(list(itertools.product(o, v)))
return expressions
trying all combinations of operations on list of variables