PYTHON PROGRAMS


PROGRAM 03 – SORT THE COURT

 

 

PROGRAM DESCRIPTION

 

A scorekeeper tracks all the points that occur during a basketball game. Write a program that will get each scoring play and output the list of total points for each player.

 

SAMPLE OUTPUT

 

     Enter player name and points during the game.

     con2

     mad2

     con2

     pat3

     con2

     mad3

     pat1

     pat1

     mad3

     done

 

     Scoring list:

     con 6

     mad 8

     pat 5

 

DETAILS

 

Your program does not need to match this sample output exactly.  You change some details.  You can make the loop as anyway you would like.

 

The inputted names and scores can have any format you want.  In the above example, the thought was that each player would have a nickname that consists of exactly 3 letters in order to make it easy to deal with the input.

 

You will likely want to use two lists.  One to keep track of all the names and one to keep track of the score totals for each name.