I just wanted to throw in a couple of ideas for you on this subject.
These are the ways I would personally think of going about this
problem:

>>> ''.join([s[n] for n in range(len(s)-1, -1, -1)])
'rac'
Which looks a bit fugly but is nice and short if you can manage list comps.

and now my favourite:

>>> l = list("car")
>>> l.reverse()
>>> ''.join(l)
'rac'

hth
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to