def cut string parts len string arr for count in xrange parts arr appe

1
2
3
4
5
6
7
def cut(string, n):
parts = len(string)//n
arr = []
for count in xrange(parts):
arr.append(s[n*count:n*count + n])
arr.append(s[n*(count+1):])
return arr