On 09/02/06, Victor Bouffier <[EMAIL PROTECTED]> wrote: > I'd like to split a long string into equally long strings (len(str) = > 3). I did the following using regexes:
Remember that a string is just like a list (except that you can't modify it). So, for instance: >>> n = 'xb1jyzqnd1eenkokqnhep6vp692qi9tmag3owzqw0sdq3zjf' >>> n[0:3], n[3:6] ('xb1', 'jyz') Can you see how to generate the slice boundaries for the length you need? -- John. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor