Yep, as mentioned by @core1320869428, .append() only lets you add a single item to the end of a list including another list as a single item. For example:
fruits = ['apples', 'oranges', peaches']
numbers = [1, 2, 3]
fruits.append(numbers)
print(fruits)
[‘apples’, ‘oranges’, ‘peaches’, [1, 2, 3]] -----> #Note that numbers is listed as a single item and not incorporated as individual items onto the fruits list.
The (+) operator allows you to add an existing list with other other items in a separate list to create a new variable storing the combined list. For example:
fruits = ['apples', 'oranges', 'peaches']
numbers = [1, 2, 3]
fruit_number = fruits + numbers
print(fruit_number)
[‘apples’, ‘oranges’, ‘peaches’, 1, 2, 3] #Note these are separate list items in a new list variable (fruit_number).
On a side note, if you want to extend an existing list similar to .append(), but with multiple, separate list items, then use the .extend() function or the +=
operator. For example:
fruits = ['apples', 'oranges', 'peaches']
numbers = [1, 2, 3]
fruits.extend(numbers) #or fruits += numbers
print(fruits)
[‘apples’, ‘oranges’, ‘peaches’, 1, 2, 3]---->#Note that the numbers list is incorporated into the existing fruits list as separate, list items.