10.3. List LengthΒΆ
As with strings, the function len
returns the length of a list
(the number of items in the list).
Check your understanding
- 4
- len returns the actual number of items in the list, not the maximum index value.
- 5
- Yes, there are 5 items in this list.
list-3-1: What is printed by the following statements?
a_list: [int]
a_list = [3, 67, 14, 31, 53]
print(len(a_list))
You have attempted of activities on this page