1
00:00:00,610 --> 00:00:07,470
We defined this function in the previous lectures which is able to calculate the mean of a list.

2
00:00:07,510 --> 00:00:18,660
However what happens if instead of passing a list
as input we passed a dictionary so student grades

3
00:00:18,750 --> 00:00:21,260
is this dictionary here.

4
00:00:21,300 --> 00:00:23,190
Let's see what's going to happen.

5
00:00:26,940 --> 00:00:33,900
Well it says an unsupported operand type, so an error will occur with the sum function because it will

6
00:00:33,900 --> 00:00:41,700
try to add up strings and integers and this function is not designed to process dictionaries.

7
00:00:41,690 --> 00:00:43,760
It is designed to process list.

8
00:00:43,920 --> 00:00:48,960
So how can we make this function to process both lists and dictionaries?

9
00:00:48,990 --> 00:00:51,980
We can do that using conditionals.

10
00:00:52,020 --> 00:00:55,420
Let's see how to do that in the next videos.

