Robert Kern wrote: > Michael Hoffman wrote: > >> Robert Kern wrote: > > >>> Well, that part's easy at least: >>> >>> live[::-1] >>> >>> :-) And so the circle is complete ... >> >> >> What about reversed(live)? Or if you want a list instead of an >> iterator, list(reversed(live))? > > > That's fine if you want to iterate over it. Often, especially with > strings, you just want an object of the same type back again. > Then you could use: ''.join(reversed(live))
though, I think that live[::-1] is the most obvious way to do it. :-) Regards, Jim Sizelove -- http://mail.python.org/mailman/listinfo/python-list