python學習筆記(一 pythonic)

1 字符串反轉 #pythonic def reverse_str( s ): return s[::-1] #not pythonic def reverse_str( s ): t = '' for x in xrange(len(s)-1,-1,-1): t += s[x] return t 2 For循環的索引 #pythonic x =
相關文章
相關標籤/搜索