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).
- Find the size of a list - Python
- Python - List of N size increasing lists
- Python | Categorize the given list by string size
- Python | Size Range Combinations in list
- Python | Size and element exponentiation of list
- 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 - Fill Strings for size K in Tuple List
- Python | Sort list of lists by the size of sublists
- Python | Increase list size by padding each element by N
- Find the size of a Set in Python
- Python | Find maximum length sub-list in a nested list
- Find the size of a Dictionary in Python
- Find the size of a Tuple in Python
- How to find size of an object in Python?
- 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
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.