Article From:https://www.cnblogs.com/sea-stream/p/9971335.html

 

def string_reverse(str1):
    rstr1 = ''  
    index = len(str1)  
    while index > 0:  
        rstr1 += str1[ index - 1 ]  
        index = index - 1  
    return rstr1  
print(string_reverse('1234abcd'))

 

Link of this Article: Inversion of Python string

Leave a Reply

Your email address will not be published. Required fields are marked *