Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
len
len
Return the length (the number of items) of an object.
Python 3.13
len
(
s
)
s
A sequence (string, bytes, tuple, list, or range) or a collection (dictionary, set, or frozenset).
Examples
Python 3.13
>>
>
len
(
"hello"
)
5
Python 3.13
>>
>
len
(
[
1
,
2
,
3
]
)
3