Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python List insert() Method
Description:
This method inserts object obj into list at offset index.
Syntax:
Parameters:
Here is the detail of parameters:
Return Value:
It returns none but it inserts the given element at the given index.
Example:
#!/usr/bin/python
aList = [123, 'xyz', 'zara', 'abc'];
print "Final List : ", aList.insert( 3, 2009);
|
This will produce following result:
Final List : [123, 'xyz', 'zara', 2009, 'abc']
|
|
|
|