リスト
基本
list = [0, 1, 2, 3]
n番目の要素の参照
value = list[n]
部分リストの取得
# [first, last)の部分リストを取得する values = list[first:last]
追加
list = [] list.append(0) list1 += list2
更新
# n 番目の要素を更新する list[n] = value
削除
# n 番目を削除する del(list[n]) # 最初の該当の値を削除する list.remove(value)
すべての要素をクリアする
list = []
値の有無
exist_value = value in list not_exist_value = not value in list # まあ普通 not_exist_value = value not in list # こっちもOK.
指定の値を持つ要素のインデックス
index = list.index(value)
指定の値を持つ要素の数
index = list.count(value)