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
|
2598 Discussions
|
Please Login in order to post a comment
m = '\n'.join( ''.join(dict.fromkeys(group)) for group in [group for group in batched(string, k)])
import textwrap
def merge_the_tools(string, k):
import textwrap def merge_the_tools(string, k): wrapper = textwrap.TextWrapper(width=k) h = wrapper.wrap(string) for s in h: s = list(s) for i in s: while s.count(i) > 1: s.reverse() s.remove(i) s.reverse() print(''.join(s))
This part of code should be used in the funtion given