Write a program that uses a while loop to store goals and assists for Lightning players in a text file called player_data.txt. The program should prompt the user for player names, goals, and assists as shown below. Enter data for at least five players. You can make up the names and data. Each datum should be stored on its own line in the file.
Python Question #6
Two programs are required and pseudocode is needed for each step
program6_1.py
Write a
Sample Output (see 6_1.png)
program6_2.py
This program reads the text file created in the program above and displays its data. Use f-strings to create a table of rows and columns with column headings as follows:
- PLAYER COLUMN: 10 characters wide and left-aligned.
- GOALS COLUMN: 6 characters wide and centered.
- ASSISTS COLUMN: 8 characters wide and centered.
- TOTAL COLUMN: 6 characters wide and centered.
After printing the stats for each player, the program should report the name of the top scorer and his total points (goals + assists).
Sample Output (see image 6_2.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images