
Problem –
You want to know how many items in a list in python.
Solution –
To get the number of elements in a list in python, you can use the built-in len() function.
In [1]: lst = [5, 10, 15, 20, 25]
In [2]: len(lst)
Out[2]: 5
You want to know how many items in a list in python.
To get the number of elements in a list in python, you can use the built-in len() function.
In [1]: lst = [5, 10, 15, 20, 25]
In [2]: len(lst)
Out[2]: 5