A student is writing an educational game in which the user attains scores in two different areas.The student would like the players to be able to keep those scores when they resume the game after having closed it. Drag the statements from the stack at the right of the screen to their correct positions at the left to show the code that they should write. Then press the Check button.
f.write("/n" + str(score2))
f.close()
f = open("scores.txt", "r")
Start of game
Close of game
Sorry. Not all correct.
variables = f.readlines()
score1 = variables[0]
f=open("scores.txt", "w")
score2 = variables[1]
Well done! All correct.
f.write(str(score1))
Check
Show
File handling operations