Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Abhayparashar31/7fa390f6f05b4cf968c901f45c63ad39 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/7fa390f6f05b4cf968c901f45c63ad39 to your computer and use it in GitHub Desktop.
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