append()
noun
say it: “uh-PEND” /əˈpɛnd/
The list method that adds one item to the end of a list.
What does append() do?
append() adds one item to the end of a list.
playlist = ["Song A"]
playlist.append("Song B")
print(playlist) # ['Song A', 'Song B']
In a sentence
- “playlist.append("Song B") put the new song last.”
- “Each loop pass appends one total to the results list.”
Level: Apprentice · More Python terms at this level
Updated