How to get Size of List in Python
The size of a list can be easily found using the built-in list function len()
.
This function returns the length, i.e, the number of items of an object. The argument passed on to the function can be a sequence such as string, bytes, tuple, list, etc, or a collection such as dictionary, set, etc.
a = ['ab', 'cde', 'fghi'] print("The length of the list is ", len(a))
Output:
The length of the list is 3
Subscribe
Login
Please login to comment
0 Discussion