Input : a = [1, 2, 3, 1, 2, 3] Output : 6 Count the number of entries in the list a. Input : a =  Output : 0
The idea is to use len() in Python
The length of list is: 4
The length of list is: 3
How does len() work?
len() works in O(1) time as list is an object and has a member to store its size. Below is description of len() from Python docs.
Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).
- Python | Categorize the given list by string size
- Python | Subgroups of i'th index size in list
- Break a list into chunks of size N in Python
- Python | Combinations of elements till size N in list
- Python | Increase list size by padding each element by N
- Python | Sort list of lists by the size of sublists
- Python | Find maximum length sub-list in a nested list
- Python Counter to find the size of largest subset of anagram words
- Python | Find all triplets in a list with given sum
- Python | Find Min/Max in heterogeneous list
- Find average of a list in python
- Find Median of List in Python
- Python | Ways to find length of list
- Python | Find k longest words in given list
- Python | Ways to find indices of value in list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.