嗨,我试图用字符串参数创建函数并返回有序排列字典。示例:
word ='abc';func(word)-> [a,b,c,ab,ac,bc,abc]
[itertools.combinations以字典顺序返回
类似的东西
def word(w): for i in range(len(w)): yield from itertools.combinations(w,i+1)