Since the condition of total < 20 is exclusive of the other conditions, couldn't you say:
```
if (total < 20):
    # gray case
elif (total_gt_67 > 0) etc:
    # green case
elif (total_gt_67 > 0) etc:
    # blue case
else:
    row_color[exam['title']] = 'red'
```
    This seems simpler to me than including the total check in all the other cases, and I think it's clearer to read.