We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- Merge the Tools!
- Discussions
Merge the Tools!
Merge the Tools!
Sort by
recency
|
2618 Discussions
|
Please Login in order to post a comment
u_string.append(s)
It is a little lengthy but worked for me
def merge_the_tools(string, k): # your code goes here st = string sub_string_list = [] for i in range(int(len(st)/k)): sub_string = "" count = i for j in range(k): sub_string += st[count*k + j] sub_string_list.append(sub_string)
code
def merge_the_tools(string, k): text = "" for i in string: text += "".join(i) if len(text) == k: for i in range(len(text)): s = "".join(sorted(set(text), key=text.index)) print(s) text = ""