The + operator creates a new list in python when 2 lists are combined using it, the original object is not modified. On the other hand, using methods like extend and append, we add the lists in place, ie, the original object is modified. Also using append inserts the list as a object while + just concatenates the 2 lists.
list1 = [1, 2, 3] list2 = ['a', 'b'] list3 = list1 + list2 print(list3)
This will give the output −
[1, 2, 3, 'a', 'b']
When using append −
list1 = [1, 2, 3] list2 = ['a', 'b'] list1.append(list2) print(list1)
This will give the output −
[1, 2, 3, ['a', 'b']]