Lesnic

Untitled

Jan 22nd, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. instr = input()
  2. size = len(instr)
  3. for i in range(1, size+1):
  4.     if size % i != 0:
  5.         continue
  6.     check = True
  7.     for j in range(1, size//i):
  8.         if instr[:i] != instr[j * i:(j+1) * i]:
  9.             check = False
  10.             break
  11.     if check:
  12.         print(size // i)
  13.         break
  14.  
Advertisement
Add Comment
Please, Sign In to add comment