You are viewing a single comment's thread. Return to all comments →
from itertools import combinations mystr, k=list(input().split(' ')) string = sorted(mystr) for x in range(1,int(k)+1): res = list(combinations(string, x)) for i in sorted(res): restr = ''.join(i) print(restr) rest = ''
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 →