@@ -0,0 +1,1109 @@
+# -*- coding: utf-8 -*-%0A%0Afrom csv import reader%0Aimport math%0Afrom matplotlib import pyplot as plt%0A%0Adef takeAverage(el):%0A    return el%5B'average'%5D%0A%0Awith open('data.csv', 'rb') as csvFile:%0A    csvReader = reader(csvFile, delimiter=';', quotechar='%7C')%0A  %0A    students = %5B%5D%0A    moda = %7B%7D%0A    sum = 0%0A    %0A    for row in csvReader:%0A        average = ( float(row%5B1%5D) + float(row%5B2%5D) ) / 2%0A        sum += average%0A        students.append(%7B %0A            'id': row%5B0%5D, %0A            'average': average %0A        %7D)%0A    %0A    students.sort(key=takeAverage)%0A    %0A    for row in students:%0A        if row%5B'average'%5D in moda:%0A           moda%5Brow%5B'average'%5D%5D += 1%0A        else:%0A            moda%5Brow%5B'average'%5D%5D = 0%0A        %0A    theModa = %7B 'key': -1, 'value': -1%7D;%0A        %0A    for key, value in moda.iteritems():%0A        if value %3E theModa%5B'value'%5D:%0A            theModa%5B'value'%5D = value%0A            theModa%5B'key'%5D = key%0A    %0A    # print students    %0A    print sum / len(students) %0A    print students%5Bint(math.floor(len(students) / 2)) - 1%5D%5B'average'%5D%0A    print theModa%5B'key'%5D%0A    %0A    %0A    # falta gerar o gr%C3%A1fico%0A    %0A    %0A    %0A

Create q3.py