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
|
2584 Discussions
|
Please Login in order to post a comment
for i in range(0, len(string), k): print("".join(list(set(string[i: i+k ]))))
Simple and straight-forward
n = len(string) t = [string[x_start: x_end] for x_start, x_end in zip(range(0, n, k), range(k, n+k, k))] for t_i in t: u_0 = '' for i, u_i in enumerate(t_i): if u_i not in t_i[:i]: u_0 += u_i print(u_0) `