-1

If I have a string (that has for example 76 characters), and I want to split it into separate smaller strings, each having 19 characters and add them into a list, how would I do this?

1 Answers1

0

Try this: Use the range's step parameter. Then slice using l[number:number+19]

l2=[l[i:i+19] for i in range(0,len(l),19)]