You are viewing a single comment's thread. Return to all comments →
def perm_string(s, n): import itertools sorted_s = sorted(s) perms = itertools.permutations(sorted_s, n) return [print(''.join(a)) for a in perms] string_num = input().split() string = string_num[0] num = int(string_num[1]) perm_string(string, num)
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 →