How can I take a string like '123456789' and return '12, 23, 34, 45, 56, 67, 78, 89'? This method needs to also work for 3 and 4 and so on long answers. I have seen a lot of ways to split it into '12, 34, 56...' but this will not work for me. Base python would be preferable but is not required. Thanks!
Asked
Active
Viewed 17 times
0
-
1`[ S[i-n:i] for i in range(n,len(S)+1) ]` – Alain T. Sep 27 '21 at 02:14