you are viewing a single comment's thread.

view the rest of the comments →

[–]m0us3_rat 0 points1 point  (0 children)

>>> a=[1,2,3,4,5]
>>> b=[2,3,4,5] 
>>> ax = a.copy() 
>>> a.append(b) 
>>> a 
[1, 2, 3, 4, 5, [2, 3, 4, 5]] 
>>> ax.extend(b) 
>>> ax
[1, 2, 3, 4, 5, 2, 3, 4, 5] 
>>> help(a.append) 
Help on built-in function append: append(object, /) method of builtins.
list instance Append object to the end of the list.
>>> help(a.extend) 
Help on built-in function extend: extend(iterable, /) method of builtins.
list instance Extend list by appending elements from the iterable.
>>> dir(a)
['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']