Challenge: Score Logger
Explore how to develop a Python program that collects user names and scores, saves them to a file, and reads stored data for display. This lesson helps you understand file handling, user input, and data storage to build reusable, interactive programs.
We'll cover the following...
We'll cover the following...
Create a program that allows users to enter their names and scores and saves the information to a file.
Steps:
Prompt the user for their name and score.
Open a file called
"scores.txt"in append mode ("a") and write the name and score to it.After saving the score, read the file’s contents and display them so the user can see all stored scores.
If you don’t know how to do this, click the “Show Hint” button.
# Write your code here.
Taking player input and saving their score to a file