0
Q:

how to add an item to a list

list.append(item)
12
myList = [1, 2, 3]

myList.append(4)
6
my_list = []
item1 = "test1"
my_list.append(item1)

print(my_list) 
# prints the list ["test1"]
6
list = []
list.append(var)
4
names = [yaron,roni]
names.append(abram)
6
numbers = [1, 2, 3, 4]
numbers.append(10)
print(numbers)
1
# to add an item to a list
list.append(item)

# To extend an list with a new list
list1.extend(list2)
0

New to Communities?

Join the community