x = [1, 2, 3]
0 以降)。e = x[1] # e == 2
+ 演算子をサポートしています。例:x = [1, 2] + [3, 4] # x == [1, 2, 3, 4] x = ["a", "b"] x += ["c"] # x == ["a", "b", "c"]
['a', 'b', 'c', 'd'][1:3] # ['b', 'c'] ['a', 'b', 'c', 'd'][::2] # ['a', 'c'] ['a', 'b', 'c', 'd'][3:0:-1] # ['d', 'c', 'b']
メンバー
append
None list.append(item)
パラメータ
| パラメータ | 説明 | 
|---|---|
| item | 必須 末尾に追加する項目。 | 
クリア
None list.clear()
延長
None list.extend(items)
パラメータ
| パラメータ | 説明 | 
|---|---|
| items | 必須 末尾に追加する項目。 | 
index
int list.index(x, start=None, end=None)
パラメータ
| パラメータ | 説明 | 
|---|---|
| x | 必須 検索するオブジェクト。 | 
| start | int; or None、
                                     デフォルト = None検査するリスト部分の開始インデックス。 | 
| end | int; or None、
                                     デフォルト = None検査するリスト部分の終了インデックス。 | 
挿入
None list.insert(index, item)
パラメータ
| パラメータ | 説明 | 
|---|---|
| index | 必須 指定された位置のインデックス。 | 
| item | 必須 商品アイテム。 | 
ポップ
unknown list.pop(i=-1)
index が指定されていない場合は、リスト内の最後のアイテムが削除されて返されます。
          
      パラメータ
| パラメータ | 説明 | 
|---|---|
| i | int; or None、
                                     デフォルト = -1商品アイテムのインデックス。 | 
削除
None list.remove(x)
パラメータ
| パラメータ | 説明 | 
|---|---|
| x | 必須 削除するオブジェクト。 |