Page 313 - Beginning Programming with Pyth - John Paul Mueller
P. 313
function.
2. Click Run Cell.
Python outputs the results of using the Counter object, as shown in Figure 13-21.
Notice that the information is actually stored in the Counter as a key and value pair. Chapter 14 discusses this topic in greater detail. All you really need to know for now is that the element found in MyList becomes a key in ListCount that identifies the unique element name. The value contains the number of times that that element appears within MyList.
FIGURE 13-21: The Counter is helpful in obtaining statistics about longer lists.