The len()
function can be used with several different types in Python – both built-in types and library types. For example:
>>> len([1, 2, 3])
3
More Related Contents:
- What does += mean in this context?
- How to name a file using a value in a list in a dictionary?
- How do I initialize a dictionary of empty lists in Python?
- How to return dictionary keys as a list in Python?
- How to convert list to string [duplicate]
- if else in a list comprehension [duplicate]
- How would you make a comma-separated string from a list of strings?
- Basics of recursion in Python
- Python -Intersection of multiple lists?
- Python: Removing list element while iterating over list [duplicate]
- In Python, when to use a Dictionary, List or Set?
- How to find the last occurrence of an item in a Python list
- Convert a list with strings all to lowercase or uppercase
- What is the inverse function of zip in python? [duplicate]
- List sorting with multiple attributes and mixed order
- How to merge multiple lists into one list in python? [duplicate]
- django – convert a list back to a queryset [duplicate]
- How to convert a string of space- and comma- separated numbers into a list of int? [duplicate]
- How to remove multiple items from a list in just one statement?
- Create random list of integers in Python
- Write and read a list from file
- How to flatten a tuple in python
- Why does df.apply(tuple) work but not df.apply(list)?
- How to concatenate element-wise two lists in Python [duplicate]
- Identify duplicate values in a list in Python
- Creating a dictionary with list of lists in Python
- Loop through list with both content and index [duplicate]
- In Python, is there an elegant way to print a list in a custom format without explicit looping?
- Python: Random numbers into a list
- How to create a nested dictionary from a list in Python?