I am creating a .txt file to store scores in my snake game. The problem is writing back into the file. my current idea goes somewhat like this:
for line in open("scoreboard.txt", "r+"):
line = scorelist[y] + namelist[y]
I've already read through the scores, made them into a list, and incorporated a new score, but I can't figure out how to simultaneously cycle through both a line and the lists i'm storing the data in to process, and overwrite the old scores.
scoreboard.txt.