Dear Marty,
>... Or, by extending Alan's solution ... > >def splitStringByN(s, n): > for m in range(0, len(s), n): > yield s[m:m+n] > >k = 'abcdefghi' >list(splitStringByN(k, 2)) It seems to be the most readable solution for me. >As it turns out, this is similar to an ASPN Cookbook recipe contributed >by Dmitry Vasiliev: >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302069 > >HTH, >Marty Thanks for the link. Best regards, Janos _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor