list.append(item)
myList = [1, 2, 3] myList.append(4)
my_list = [] item1 = "test1" my_list.append(item1) print(my_list) # prints the list ["test1"]
list = [] list.append(var)
names = [yaron,roni] names.append(abram)
numbers = [1, 2, 3, 4] numbers.append(10) print(numbers)
# to add an item to a list list.append(item) # To extend an list with a new list list1.extend(list2)