ReferenceList methods
list.append()
Adds one item to the end of the list, in place.
Signature
items.append(item)Parameters
| Name | Means |
|---|---|
item | anything, 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']