Python - List Length
The Python len() function can be used to find out the total number of elements in the list. Along with this, len() function returns the number of elements of any iterable. An iterable object can be any data structure like list, tuple, set, string and dictionary, etc.
Returns the total number of elements in the list.
In the below example, Python len() function is used on the list called MyList to find out the total number of elements in it.
MyList = [10, 20, 30, 40, 50, 60] print(len(MyList))
The output of the above code will be:
❮ Python List Methods