Copyright © tutorialspoint.com
This function returns the number of elements in the list.
len(list) |
Here is the detail of parameters:
list: a list for which number of elements to be counted.
It returns the number of elements in the list.
#!/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 |
Copyright © tutorialspoint.com