[EMAIL PROTECTED] wrote: > so if I want to reverse it fully using s[len(s)-1:x:-1] what would x be > or is it impossible to express it in this way ?
This does not work for integers, because the theoretically correct value x = -1 already has another interpretation as the gap between the last and the last but one character. Here are two workarounds: 1. Set x to None >>> s = "12345" >>> s[len(s):None:-1] '54321' 2. Separate slicing operation and reversal: >>> s = "12345" >>> s[0:len(s)][::-1] '54321' Peter -- http://mail.python.org/mailman/listinfo/python-list