append()
` method. Here's an example program :my_list = [1, 2, 3, 4, 5]
print("Original list:", my_list)
# Append an item to the end of the list
my_list.append(6)
print("List after appending an item:", my_list)
Original list: [1, 2, 3, 4, 5]
List after appending an item: [1, 2, 3, 4, 5, 6]
my_list
` containing five items. Then we use the `append()
` method to add an item `6
` to the end of the list. The updated list is then printed to the console.