I have code like this:
winners = [red, blue, yellow]
player_1_guesses = [red, green, orange]
player_2_guesses = [red, blue, orange]
player_3_guess = [red, green, yellow]
I'd like to count how many times each value in winners appears across the three player_x_guesses lists. So I would expect to see something like:
totals = {'red': 3, 'blue': 1, 'yellow': 1}
I'm not really sure what this kind of data analysis (?) is called or even what to google to achieve what I want.
Thanks for any help.
Countercollection : docs.python.org/3/library/collections.html#collections.Countercollections.Counter