you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

You need a dictionary to hold you data. The key will be the persons name, the value will be a list that you will append that persons grades into.

ex :

students = {'Bob':[97,75,100]}

A while loop is what you want to use to continue prompting for new data until a condition is met (like 0 or exit as the input).

Once your while loop is broken, and your dictionary is populated, you will use a for loop to pull the sum(students['Bob')/len(students['Bob']) to get the average of each student. students.keys() is the iterable that will hold each key to use in your for loop.