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).
- Break a list into chunks of size N in Python
- Python | Categorize the given list by string size
- Python | Subgroups of i'th index size in list
- Python | Sort list of lists by the size of sublists
- Python | Combinations of elements till size N in list
- Python | Increase list size by padding each element by N
- Python | Find maximum length sub-list in a nested list
- Python Counter to find the size of largest subset of anagram words
- Python | Find Min/Max in heterogeneous list
- Find average of a list in python
- Python | Find all triplets in a list with given sum
- Find Median of List in Python
- Python - Find Minimum Pair Sum in list
- Python | Find k longest words in given list
- Python | Find Mean of a List of Numpy Array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.