with open('file.csv') as input_file:
    for row in csv.reader(input_file, delimiter=';'):
        grades[row[1]] += 1
print('Number of A grades: %s' % grades['A'])
print(grades.most_common())
Python algorithm of counting occurrence of specific word in csv