Merge the Tools!

Sort by

recency

|

2633 Discussions

|

  • + 0 comments
    import textwrap
    def merge_the_tools(string, k):    
        wrapper = textwrap.TextWrapper(width = k)
        word_list = wrapper.wrap(text=string)
        for x in word_list:
            print("".join(dict.fromkeys(x)))
    
  • + 0 comments

    def merge_the_tools(string, k): for i in range(0, len(string), k): substring = string[i:i + k] result = "" seen = set() for char in substring: if char not in seen: result += char seen.add(char) print(result)

  • + 0 comments

    def merge_the_tools(string, k): for i in range(0, len(string), k): substring = string[i:i + k] result = "" seen = set() for char in substring: if char not in seen: result += char seen.add(char) print(result)

  • + 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)

  • + 0 comments

    import textwrap

    # your code goes here
    
        for x in textwrap.wrap(string, k):
            my_list = list(dict.fromkeys(x))
            print( ''.join(my_list) )