Try reading up on sequences and slicing. They offer a very elegant solution to your (homework?) problem. http://docs.python.org/tutorial/introduction.html#strings -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/tutor/attachments/20090923/81c94d8f/attachment.htm>