Question: This question deals with python graphics.py I have a functioning python game currently. I need to make a highscores list but am stuck. This highscores
This question deals with python graphics.py
I have a functioning python game currently.
I need to make a highscores list but am stuck.
This highscores list HAS to:
-be a .txt file called "the_highscores"
if the file is not already there, create the file with the default highscore:
Player Name Score
Jane Doe 10
-write the highscore to the file
the highscore file only displays the 5 highest scores so basically after the game is complete if the score is higher than on of the scores in the list then add it to the highscore txt file
I am not sure how to create a function (or whatever) that adds the score to the highscore list if is a highscore and only display the top 5 scores.
My game function returns the final score and name to the variables: final_score (for the score) and player_name(for the player name)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
