solved string reverse in python