Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python List extend() Method
Description:
This method appends the contents of seq to list.
Syntax:
Parameters:
Here is the detail of parameters:
Return Value:
It returns none but add the content to existing list.
Example:
#!/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']
|
|
|
|