list1 = ["One", "value"]
list1.append("to add") # "to add" can also be an int, a foat or whatever"
# list is now ["One", "value","to add"]
#Or
list2 = ["One", "value"]
# "to add" can be any type but IT MUST be in a list
list2 += ["to add"] # can be seen as list2 = list2 + ["to add"]
# list2 is now ["One", "value", "to add"]
# but it have been reconstructed so no side-effects on copied lists will occure
EmptyList = []
list = [1,2,3,4]
#for appending list elements to emptylist
for i in list:
EmptyList.append('i')
# append method adds an element at the end of the list
foo = [1, 2, 3]
foo.append(4)
print(foo)
# Output - [1, 2, 3, 4]
lst=[1,2,3,4]
print(lst)
#prints [1,2,3,4]
lst.append(5)
print(lst)
#prints [1,2,3,4,5]
characters = [‘Tokyo’, ‘Lisbon’, ‘Moscow’, ‘Berlin’]
characters.append(‘Nairobi’)
print(‘Updated list:’, characters)
list1 = [1, 2, 3]
list2 = [3, 4, 5]
list1.append(list2)
list3 = [1, 2, 3]
list4 = [1, 2, 3]
list3.append(‘abc’) # will return [1, 2, 3, ‘abc’]
list4.extend(‘abc’)# will return [1, 2, 3, ‘a’, ‘b’, ‘c’]
>> list = ["Facebook", "Instagram", "Snapchat", "Twitter"]
>> list.append("TikTok")
>> print(list)
["Facebook", "Instagram", "Snapchat", "Twitter", "TikTok"]