
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How do we get size of a list in Python?
Python's built in function len() returns number of elements in a sequence including list object.
>>> L1=[1,2,3,4,5] >>> len(L1) 5
The built-in function len() implements the __len__() method defined for all sequence type classes including list class. It also returns size.
>>> L1.__len__() 5
- Related Articles
- How do we get the size of a list in Python?
- How to get the size of a list in Python?
- How do I get list of methods in a Python class?
- How do we specify the buffer size when opening a file in Python?
- How do we create python string from list?
- How do I get a list of all instances of a given class in Python?
- How do I set the size of a list in Java?
- How do I find the size of a Java list?
- Find size of a list in Python
- How to get the size of a string in Python?
- How do we assign values to variables in a list using a loop in Python?
- How do we add a menu list in HTML?
- How do we get food?
- How do you get the file size in C#?
- How do make a flat list out of list of lists in Python?

Advertisements