Python:List列表中的常用方法總結

Extend():合併(可以將兩個數組合併到一個裏面) Remove():移除 Sort():排序 Clear():清除全部內容 Count():統計個數 Index():定位 Pop():刪除某個下標上的值,names.pop(0)#這一句等於 del names[0]   Insert():插入到某個位置上去,列表自動後移 Append():在最後面插入 Reserve():反轉 Copy()
相關文章
相關標籤/搜索