I initially had it so that the contents stored in the names & scores files would save even after closing the program. Now, something went wrong and the files delete their contents after closing the program and I don't know why.
Here's my code. You can check out what's going on for yourself.
To win a game quickly, just pick a difficulty, and during the game input '+'. That will give away the answer so that you can win quickly and get a score logged into the scoreboard.
As you can see I've been trying to pinpoint the issue with some test prints.
I edited it a bit but now it deletes scores one by one every time I call to print it after restarting the program. So, similar problem. It doesn't completely clear the score files after turning off the program like it did before.