如何使所有可能的组合都脱离字母,但并非所有字母都需要使用?

我正在用Python创建一个项目,它包含一个函数,该函数从作为参数给出的字母中返回所有可能的组合,但并非必须使用所有字母。 这是我当前的功能:

from itertools import product
def algorithm(letters):
    possible = [''.join(combination) for combination in product(letters, repeat=len(letters))]
    return possible
print(algorithm(['a','b','c','d','e']))

但它只返回其中具有所有字母的组合。它不会返回如下组合:

abc
cba
de
ad

等等 谁能帮我?