[Tutor] Reversing

Poor Yorick tutor.python.org at pooryorick.com
Wed Jul 20 21:00:48 CEST 2005

Kevin Bixler wrote:

> I was asked to make a program that reverses the text that a user would 
> input. I have tried what I thought would work which is 
> phrase.reverse(). phrase = the raw_input. Help!
> Thank you,
> Kevin Bixler

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on 
Type "help", "copyright", "credits" or "license" for more information.
 >>> a = 'hello there'
 >>> a[::-1]
'ereht olleh'

More information about the Tutor mailing list