On this page
  1. list
  2. Import & Availability
  3. Overview & Signature
  4. Common Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

list

Prev: license | Up: __builtins__ | Next: locals
Rel: bool, int, float, complex, str
Ref: docs.python.org — list
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import list

Overview & Signature

list(iterable=(), /)

Built-in mutable sequence.

Common Methods & Attributes

Usage

xs = list(range(4))
xs.append(4)
assert xs == [0, 1, 2, 3, 4] and xs[-2:] == [3, 4]

Gotchas

REPL Inspect

help(list)

Linked from

Related notes