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