Saturday, January 5, 2008

Reverse A String In Python


How to reverse a string?

s = 'abc'
s = s[::-1]
print s


Simple! :-)

No comments:

Post a Comment