I figured it out.
string = '123456789'
splitted = []
prev = 0
while True:
n = random.randint(1,3)
splitted.append(string[prev:prev+n])
prev = prev + n
if prev >= len(string)-1:
break
print splitted
0
solved Split string by n when n is random