어떻게이 튜플 ("A", "E", "L")을 취하고 문자를 반복하지 않고 가능한 모든 단어를 생성합니까? 그 결과는 단 한 개의 문자로 된 3 단어, 2 개의 문자로 된 6 개의 단어 및 3 개의 문자로 된 6 개의 단어가 될 것입니다.순열 Python
def gererate(tuplo_letras):
return [i for i in itertools.permutations(tuplo_letras)]
def final(arg):
return generate(list(map(''.join, itertools.permutations(arg))))
의 중복 가능성은 https ://stackoverflow.com/questions/8306654/finding-all-possible-permutations-of-a-given-string-in-python –
Pls 자신의 시도를 게시하십시오! – schwobaseggl
DEF gererate (tuplo_letras) : itertools.permutations에서의 I를 I (tuplo_letras)] \t 창 DEF 최종 (ARG). \t 복귀 (생성 목록 (지도 ('가입 itertools.permutations (ARG))))) – Pereira