You wish to store, maintain, update, and use data for each of several baseball players. For each player you will store last name, player number, number of times at bat, and number of hits. Use a nested list to store this data.
Your program will have the following major parts. 1. Create the data structure and populate it with data. For this part, you should read the data from a text file named players.txt. You do not know how many total lines of data are in this file, but you DO know that you have 4 lines for each player. Furthermore, you also know that for each player, the data in the file is given in the order: last name, player number, at bats, hits. Finally, all data is of the expected type. (In other words, there are no tricks in the data file.) 2. Update the data in your data structure. This would correspond to the appropriate updates at the end of a game. For this part, you should go through your list of players and do the following for each player: print the name and player number to the screen, ask the user to input the number of at-bat appearances that game, ask the user to input the number of hits for that game, and then update the players record accordingly. 3. Count and output the number of players who have a batting average of 300 or higher. Note that batting average is not stored directly. You will have to compute it. Do NOT store it in the players record. 4. Count and output the number of players in each of the following classifications. 0-50 hits whiffer 51-100 hits OK 101-150 hits productive over 150 hits MVP candidate
You must design your code so that you make good use of functions. At a very minimum, you should have a function for each of the parts described above. You may, of course, use more functions than this.
The main part I need help with is #1, I know how to read in the file but I can't quite figure out how to put it into sublists.