list - Python: reverse a string -
possible duplicate:
reverse string in python
i understand data in python (strings) stored lists
example:
string1 = "foo" "foo"[1] = "o"
how use list.reverse function reverse characters in string? such input "foo" , returned "oof"
you wouldn't.
>>> "foo"[::-1] 'oof'
Comments
Post a Comment