You are viewing a single comment's thread. Return to all comments →
from itertools import permutations
S = input().split() string = str(S[0]) k = int(S[1])
list1 = list(sorted(permutations(string,k)))
for i in range(len(list1)): print(''.join(list1[i]))
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.permutations()
You are viewing a single comment's thread. Return to all comments →
from itertools import permutations
S = input().split() string = str(S[0]) k = int(S[1])
list1 = list(sorted(permutations(string,k)))
for i in range(len(list1)): print(''.join(list1[i]))