Copyright © tutorialspoint.com
This method appends the contents of seq to list.
list.extend(seq) |
Here is the detail of parameters:
seq: list of elements
It returns none but add the content to existing list.
#!/usr/bin/python aList = [123, 'xyz', 'zara', 'abc', 123]; bList = [2009, 'manni']; aList.extend(bList) print "Extended List : ", aList ; |
This will produce following result:
Extended List : [123, 'xyz', 'zara', 'abc', 123, 2009, 'manni'] |
Copyright © tutorialspoint.com