The len() function will return the number of values that are in a list value passed to it, just like it can count the number of characters in a string value.
Enter the following into the interactive shell to see the output:
>>> spam = ['cat', 'dog', 'moose']
>>> len(spam)
3
Top comments (0)