← Back to Files
Question 415
Average From A CSV
Average From A CSV
The write step stores a header line name,score and three rows in scores.csv, using the three scores read from input. The read-back with csv.DictReader is set up; inside the loop add int(row["score"]) to total and 1 to count, then after the loop print Average: <value> with two decimals (:.2f). Input: three lines, each a whole-number score, no prompt. Import only csv.
Expected Output:
Average: 80.00= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
FilesCSV
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.