We defined this function in the previous lectures,
which is able to calculate the mean of a list.
However, what happens if instead of passing a list
as inputs, we pass a dictionary, so student_grades
is the dictionary here. Let's see what's going to happen.
[Author typing]
Well, it says an unsupported operand type.
So an error will occur with the sum function
because it will try to add up strings and
integers, and this function is not designed to
process dictionaries. It's designed to process
lists. So how can we make this function to process
both lists and dictionaries? We can do that using
conditionals. Let's see how to do that in the next videos.
[Outro sound]