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
|
2649 Discussions
|
Please Login in order to post a comment
A simple Core Python code with descriptions (as comments), and without using any inbuilt function or module:
` def merge_the_tools(string, k):
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k) `
import textwrap as tp def merge_the_tools(string, k): s=tp.wrap(string,k) s1=[] for i in s: j=set(i) j=list(j) print("".join(j))
def merge_the_tools(string, k): for i in range(0,len(string),k): lst = list() for j in range(i,i+k): if string[j] not in lst: lst.append(string[j]) print(''.join(lst))
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)
def merge_the_tools(string, k): for i in range(0,len(string),k): lst = list() for j in range(i,i+k): if string[j] not in lst: lst.append(string[j]) print(''.join(lst))
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)