seprate strings into repititive substrings code example
Example: seprate strings into repititive substrings
a = "hellohellohello"
def splitstring(string):
for number in range(1, len(string)):
if string[:number] == string[number:number+number]:
return string[:number]
#in case there is no repetition
return string
splitstring(a)