00:01
Okay, let's write a function that will return the mean of all of the digits of one number.
00:10
So we can start by writing our, defining our function mean of x.
00:15
And what we're going to want to do is return mean of digits.
00:20
So the way we're going to do this is we first want to turn our number into a list of digits so that we can add them together and find how many there are, and then ultimately do our calculation.
00:35
So the way we can do this is by first using this map function.
00:42
And what this does is if we take, if we call map on a certain like iterable, like a list or string, then we can apply a function to each of the elements one by one.
00:57
And so in this case, we can use this to make a list of all of the digits.
01:04
And the way we can do that is normally the integer is not iterable just because it's stored as just a number.
01:16
And if you want to turn into something that's iterable, we can turn into a string and then go over each of the characters in that number as a string.
01:26
So if we look at this, what we do is we first add our function and then we add our iterable.
01:32
So if we're turning into a string first, we went to first, then turn it into an integer...