python 字符串反转

def reverse_str( s ):
    return s[::-1]  

  

 

def reverse_str( s ):
    t = ''
    for x in xrange(len(s)-1,-1,-1):
        t += s[x]
    return t

 

posted @ 2015-10-28 09:13  arhatlohan  阅读(168)  评论(0编辑  收藏  举报