def guess_seq_len(seq):
    guess = 1
max_len = len(seq) / 2
for x in range(2, max_len):
    if seq[0:x] == seq[x:2 * x]:
        guess = x
return guess
Python finding repeating sequence in list of integers?