Chapters
Python114 chapters

ReferenceList methods

list.append()

Adds one item to the end of the list, in place.

Signature

items.append(item)

Parameters

NameMeans
itemanything, added as a single item

Returns

None. Never assign the result.

Example

Python
names = ["Ada"]
names.append("Grace")
print(names)
print(names.append("Katherine"))
print(names)

Output

['Ada', 'Grace']
None
['Ada', 'Grace', 'Katherine']

See also