把可迭代对象中的所有元素逐个添加到列表末尾。
iterable
None
a = [1, 2] a.extend([3, 4]) a.extend("ab") print(a)
[1, 2, 3, 4, 'a', 'b']