1#append to list
2lst = [1, 2, 3]
3something = 4
4lst.append(something)
5#lst is now [1, 2, 3, 4]
1
2List = ["One", "value"]
3
4List.append("to add") # "to add" can also be an int, a foat or whatever"
5
6#List is now ["One", "value","to add"]
7
8#Or
9
10List2 = ["One", "value"]
11# "to add" can be any type but IT MUST be in a list
12List2 += ["to add"] # can be seen as List2 = List2 + ["to add"]
13
14#List2 is now ["One", "value", "to add"]
1stuff = ["apple", "banana"]
2stuff.append("carrot")
3# Print to see if it worked
4print(stuff)
5# You can do it with a variable too
6whatever = "pineapple"
7stuff.append(whatever)
8# Print it again
9print(stuff)
1EmptyList = []
2list = [1,2,3,4]
3#for appending list elements to emptylist
4for i in list:
5 EmptyList.append('i')