You are viewing a single comment's thread. Return to all comments →
from itertools import permutations
def permut(s, k): s.upper() p_val = list(permutations(s, k)) p_val.sort() [print(''.join(x)) for x in p_val]
space_sep_input = input().split() string = (space_sep_input[0]).upper() k = int(space_sep_input[1]) permut(string, k)
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
def permut(s, k): s.upper() p_val = list(permutations(s, k)) p_val.sort() [print(''.join(x)) for x in p_val]
space_sep_input = input().split() string = (space_sep_input[0]).upper() k = int(space_sep_input[1]) permut(string, k)