more newbie help needed
craig9 at gmail.com
Mon Nov 14 20:49:42 CET 2005
> Note, however, that there are more pythonic ways to perform this task.
> You might try:
> for index in range(len(fruit)):
> letter = fruit[-index-1]
> print letter
Or, if you're *really* just trying to reverse the string, then the
following might read more easily (although it's probably longer):
fruit = list(fruit)
fruit = ''.join(fruit)
It turns the string into a list, reverses it, joins it back together
(back into a string), then prints it.
More information about the Python-list