In this program, we will take a string as input and find permutations of a string using the function.
Steps to solve the program
- Take a string as input.
- From itertools import permutations to find the permutations of a string.
- Print the output.
#Input string
str1 = "CDE"
from itertools import permutations
List = permutations(str1)
for combinations in list(List):
print (''.join(combinations))
Output :
CDE
CED
DCE
DEC
ECD
EDC