← Back to Files
Question 422
Scores Saved As JSON
Scores Saved As JSON
Three whole numbers read from input are collected in the list scores and saved to scores.json with json.dump. Open the file for reading, load the list back with json.load into loaded and print two lines: Total: <sum> using sum() and Best: <max> using max(), both computed from loaded. Input: three lines, no prompt. Import only json.
Expected Output:
Total: 245 Best: 90
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
FilesJSON
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.