How to Get the Number of Items in a List in Python



Python


In this article, we show how to get the number of items in a list in Python.

This is very simple, because Python has a built-in function, len(), which is able to get the number of items in a list.

So, say we have the following list, we get the following output.



So all we have to do is use the len() function and pass in the list as its argument. This gives us the number of items in the list.

And this is all that is required to get the number of items in a list in Python.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...