def merge_the_tools(string, k): while string: # while string is not None seen = '' s = string[0:k] for c in s: if c not in seen: seen += c print(seen) string = string[k:] if __name__ == '__main__': string, k = input(), int(input()) merge_the_tools(string, k)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter