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 | Subgroups of i'th index size in list
- Python | Categorize the given list by string size
- Break a list into chunks of size N in Python
- 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 Min/Max in heterogeneous list
- Find average of a list in python
- Python | Find all triplets in a list with given sum
- Python | Find missing elements in List
- Python | Find indices with None values in given list
- Python | Find sum of frequency of given elements in the list
- Python | Ways to find indices of value in list
- Python | Find most common element in a 2D list
- Python | Find k longest words in given 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.