You are viewing a single comment's thread. Return to all comments →
devide the below code in small chunks as there are two for loops for each iterable k
str , k = input().split(' ') from itertools import combinations [print("".join(i)) for j in range(1,int(k)+1) for i in list(combinations(sorted(str),int(j)))]
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 →