Skip to main content
4 of 6
added 13 characters in body
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 59 55 53 bytes

lambda s:s in[len(s)/i*s[:i]for i in range(1,len(s))]

Try it online!


Recursive version:

Python 2, 59 54 bytes

f=lambda s,i=1:s[i+1:]and f(s,i+1)or s==len(s)/i*s[:i]

Try it online!


Boring regex version:

Python 2, 44 bytes

lambda s:re.match(r'(.+)\1+$',s)>0
import re

Try it online!

TFeld
  • 19.9k
  • 3
  • 20
  • 63