Every line of 'all possible permutations of a string' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
6 def permute(string: str) -> typing.Iterator[str]: 7 """ 8 >>> list(permute('ABC')) 9 ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA'] 10 """ 11 yield from map("".join, itertools.permutations(string))