List Methods

list.append()

Adds one object at the end of a list, preserving its identity rather than copying it. If the argument is itself a list, it becomes one nested element. Use extend() to add individual elements from an iterable. Aliases see the mutation. In CPython, repeated end appends have amortized constant-time cost under ordinary allocation conditions; a resize can cost more.

Formal Syntax & Structure

python syntaxpython
items.append(value, /)

Parameters & Attributes

NameTypeDescription
valueobjectObject to add or search for.

Return Value

None

The original list changes; no new list is returned.

Working Example

Example Snippetpython
tasks = ["draft"]result = tasks.append("review")tasks.append(["check", "send"])print(tasks)print(result)
Python Reference