Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python List len() Function
Description:
This function returns the number of elements in the list.
Syntax:
Parameters:
Here is the detail of parameters:
Return Value:
It returns the number of elements in the list.
Example:
#!/usr/bin/python
list1, list2 = [123, 'xyz', 'zara'], [456, 'abc']
print "First list length : ", len(list1);
print "Second list length : ", len(list2);
|
This will produce following result:
First list length : 3
Second lsit length : 2
|
|
|
|