A list collects many values into one place, letting a function accept a flexible number of options through one parameter. For example, a Scrabble helper can compare a list of candidate words instead of requiring separate parameters for three, five, or fifty words. section 3.3.5
Use lists to:
- Pass several words or other values to a function as one argument, using square brackets around the values. section 3.3.5
- Process each value in turn, such as comparing every word’s Scrabble score or finding the longest word. section 3.3.5 section 6.2.1
- Test ordinary, single-item, tied, and empty-string cases rather than relying on one successful example. section 6.2.1
Choosing the best word
Define best_word(word_list) with one list parameter, examine each word, calculate its score with num_points, and return the highest-scoring word. Call it as best_word(['zap', 'pack', 'quack']), which returns 'quack'; a one-word list returns that word. Calling best_word('zap', 'pack', 'quack') is incorrect because it supplies several arguments instead of one list. section 3.3.5
def best_word(word_list):
"""
word_list is a list of words.
Return the word worth the most points.
"""
Use the function signature and docstring as a compact starting point for a list-processing function. section 3.3.5




















