Reversing a string

Terry Reedy tjreedy at udel.edu
Wed Jun 27 13:58:14 EDT 2007


"Scott" <s_broscious at comcast.net> wrote in message 
news:cYWdncuhLL6PCx_bnZ2dnUVZ_o2vnZ2d at comcast.com...
| Yeah I know strings == immutable, but question 1 in section 7.14 of "How 
to
| think like a computer Scientist" has me trying to reverse one.

>>> 'this is a test'[::-1]
'tset a si siht' 






More information about the Python-list mailing list