invert the order of a string

rtilley rtilley at vt.edu
Mon Feb 13 14:03:32 EST 2006


Dave Hansen wrote:
> How about 
> 
> s = "some random string"
> print s
> s = s[::-1]
> print s

That looks like Perl, but it works. Makes me wonder with the string 
module doesn't have a reverse or invert function?




More information about the Python-list mailing list