[Tutor] Printing a list count - Help

Danny Yoo dyoo at hashcollision.org
Fri Aug 29 21:37:55 CEST 2014


>
> The above code prints 8 lines, each being an entry for which item in
> the list was either A or B. Again, I'm looking for the result to be
> the number 8 itself - the total number of instances that A or B occurs
> in the list.


Hi Derek,

Hint: the code currently prints a variable within the loop.  But you
can print the value of your variable _outside_ the loop, after all the
student_grades have been processed.


More information about the Tutor mailing list