Merge the Tools!

  • + 0 comments

    import textwrap

    def merge_the_tools(string, k): # Break string into k-sized chunks segments = textwrap.wrap(string, k)

    for segment in segments:
        unique_chars = ""
        for char in segment:
            if char not in unique_chars:
                unique_chars += char
        print(unique_chars)
    

    if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)