10 個 Python 初學者必知編碼小技巧

                               技巧 #1   字符串翻轉 a = "codementor">>> print "Reverse is",a[::-1]翻轉後的結果爲 rotnemedoc 技巧 #2 矩陣轉置 mat = [[1, 2, 3], [4, 5, 6]]>>> zip(*mat)[(1, 4), (2, 5), (3, 6)] 技巧 #3 a = [1,
相關文章
相關標籤/搜索