[Tutor] [Re] Fwd: Strings backwards
singingxduck at gmail.com
Thu Jan 19 22:49:50 CET 2006
Victor Bouffier wrote:
>I had to do the string-to-list-then-reverse-string-then-back-to-string
>process myself before knowing about this marvelous operand.
>It works on tuples (all immutable objects) too:
Not all immutable objects, just those that define __getslice__
(basically, those that use indexes: sequences). Ints, for example, are
immutable and don't work:
Traceback (most recent call last):
File "<pyshell#23>", line 1, in -toplevel-
TypeError: unsubscriptable object
Email: singingxduck AT gmail DOT com
Programming Python for the fun of it.
More information about the Tutor