List length
Input
seq_length([1, 2, 3])
Output
3
The list has three elements.
Full lesson preview
Implement a function that returns the length (number of items) of any iterable or sequence.
Problem statement
Task
Examples
Input
seq_length([1, 2, 3])
Output
3
The list has three elements.
Input format
Output format
Constraints
Samples
Input
seq_length('hello')
Output
5
Strings support len(), returning 5.