extend()

  • Description The
    extend() function is used to append multiple values ​​in another sequence at the end of the list at once (extend the original list with the new list).

  • grammar

      list.extend(seq)
    
  • parameter

      seq -- 元素列表。
    
  • Return value
    This method has no return value, but new list content will be added to the existing list.

Example:

aList = [123, 'xyz', 'zara', 'abc', 123];
bList = [2009, 'manni'];
aList.extend(bList)

print('aList:', aList)

result:

aList: [123, 'xyz', 'zara', 'abc', 123, 2009, 'manni']

Guess you like

Origin blog.csdn.net/plan_jok/article/details/110000990