python list extend
时间: 2023-11-03 17:06:19 浏览: 105
在Python中操作列表之list.extend()方法的使用
The extend() method in Python is used to add elements of one list to another list. It takes an iterable (list, tuple, string, etc.) as an argument and adds all the elements of that iterable to the end of the list. The extend() method modifies the original list and returns nothing.
Syntax:
list.extend(iterable)
Parameters:
The extend() method takes an iterable (list, tuple, string, etc.) as an argument.
Return Value:
The extend() method modifies the original list and returns nothing.
阅读全文