items = [] items.append("apple") items.append("orange") items.append("banana") # FAKE METHOD:: items.amount() # Should return 3
The len() function can be used with a lot of types in Python - both built-in types and library types.
len()
>>> len([1,2,3]) 3