1#append to list
2lst = [1, 2, 3]
3something = 4
4lst.append(something)
5#lst is now [1, 2, 3, 4]
1my_list = []
2item1 = "test1"
3my_list.append(item1)
4
5print(my_list)
6# prints the list ["test1"]
1myList = [apples, grapes]
2fruit = input()#this takes user input on what they want to add to the list
3myList.append(fruit)
4#myList is now [apples, grapes, and whatever the user put for their input]
1#Add item to python list
2languages = ['C', 'Kotlin', 'Javascript']
3user_input = input('Enter a programming language...')
4languages.append(user_input)
5for i in languages:
6 print(i)
7#Result
8>>Enter a programming language...[ Python| ]
9>>'C'
10>>'Kotlin'
11>>'Javascript'
12>>'Python'