I'm learning some commands for parsing data extracted from a CSV file and trapping in the following situation:
I want to use this CSV as the basis for averaging the room:
Nome;P1;P2;P3
Maria;8;7;10
Julia;9.5;10;7
Ailton;7;8;10
Leo;4;5;3
So far I have this, which I know to be the beginning:
import csv
with open('notas.csv', 'rb') as csvfile:
csv = csv.reader(csvfile, delimiter=';', quotechar='|')
lista = []
for row in csv:
lista.append(row)
How do I get the average room per test and after that the overall with all the tests?
I just need it printed at the end:
Média P1: X, média P2: Y, média P3: Z. Média final: A
With X the average of all P1, Y is the average of all P2, Z the average of all P3 and A average of all grades.
If more evidence or people are added, the account should continue to be made with the same code.