You are viewing a single comment's thread. Return to all comments →
from itertools import combinations string, k = input().split() k1 = int(k) upString = sorted(string.upper()) count = 1 comb = [] while count < k1+1: comb = list(combinations(upString, count)) for i in comb: print(''.join(i)) count +=1
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 →