Function Details: append

Description


Add an item to the end of the list.


Extended Description


The append() method adds a single item to the end of the list. It modifies the list in-place and doesn't return a new list. The time complexity of this operation is O(1) on average, making it an efficient way to add elements to a list.


Function Signature



Module: list

Class: list

Parameters



Parameter List


  • object: Any

Return


This method doesn't return a value. It modifies the list in-place.


Return Type


None

Output

Explanation

This example demonstrates the basic usage of append(). It adds the integer 4 to the end of the list.