def solution(s: str) -> bool:
# your code here
assert solution("abab") is True
assert solution("aba") is False
assert solution("abcabcabcabc") is True
assert solution("abaababaab") is True
def solution(astr):
flag = False
for i in range(1, int(len(astr)/2)+1):
tem = astr[0:i]
for j in range(1, len(astr)):
if tem*j == astr:
flag = True
else:
continue
return flag
def solution(s: str) -> bool:
for i in range(len(s) // 2):
if len(s) % (i + 1) == 0:
if s[:i + 1] * (len(s) // (i + 1)) == s :
return True
return False
import re
def solution(s: str) -> bool:
# your code here
for i in range(len(s)//2):
list_s = re.findall('.{'+str(i+1)+'}', s)
print(list_s)
if list_s.count(list_s[0]) == len(list_s):
return True
return False
assert solution("abab") is True
assert solution("aba") is False
assert solution("abcabcabc") is True
assert solution("abaababaab") is True
def solution(s: str) -> bool:
for i in range(len(s) - 1):
res = ''.join(s.split(s[:i + 1]))
if res == '':
return True
else:
return False
assert solution("abab") is True
assert solution("aba") is False
assert solution("abcabcabcabc") is True
assert solution("abaababaab") is True