Created
July 13, 2020 14:48
-
-
Save Abhayparashar31/7fa390f6f05b4cf968c901f45c63ad39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge_the_tools(s,num): | |
s=s | |
num=num | |
subsegments = int(len(s) / num) | |
for i in range(subsegments): | |
t = s[i * num : (i + 1) * num] ##indexing of the string | |
u = "" | |
for c in t: | |
if c not in u: | |
u += c | |
print(u) | |
if __name__ == '__main__': | |
string, k = input(), int(input()) | |
merge_the_tools(string, k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment