📅  最后修改于: 2022-03-11 14:45:45.223000             🧑  作者: Mango
import itertools
if __name__ == '__main__':
nums = list("ABC")
permutations = list(itertools.permutations(nums))
# Output: ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']
print([''.join(permutation) for permutation in permutations])