Module 5
len()
Counting items in a list.
How many items?
The len() function works on lists too. It returns the number of items.
Python
samples = ["control", "treatment", "blank"] print(len(samples))
→ 3
What does len(["a", "b", "c"]) return?
Counting items in a list.
The len() function works on lists too. It returns the number of items.
samples = ["control", "treatment", "blank"] print(len(samples))
What does len(["a", "b", "c"]) return?