python combinations of letters code example
Example: python print combinations of string
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])