00:01
Welcome to this lesson.
00:02
In this lesson we will define a python function, a leaf.
00:07
We will take in a string and we will return the number of vowels in the string.
00:14
Let's go here, let's go on.
00:16
Now let's have a dictionary that also has key -value pairs.
00:20
And now the key would be the vowels and the pair would be the frequency of them in the string.
00:28
So i'll say vowels.
00:39
So i'll have each of them initially have a frequency of 0.
00:44
So each of the 5 vowels will have a frequency of 0 initially.
00:53
Then with this i can update it as i see the new vowel.
01:02
So this is 4, this is actually 0.
01:13
So the last part, no list i have.
01:17
There you go.
01:18
The next step is to go through the list, go through the string and actually see which of its characters are vowels.
01:36
Then with that one we can update the values in the vowels.
01:42
So i'll say for small s in big s.
01:47
Well here i want to convert it to lowercase so that i will not have to deal with case sensitivity issues.
01:55
I'll say if there's a key or s in the vowels dictionary.
02:07
If this is so, then i'm going to update my vowel.
02:12
I'm going to update it with the same key but now a different value.
02:21
The value would be the vowels are storing key -value pairs.
02:26
And the key is the vowel and the value is the frequency they have.
02:33
So first of all, if i'm updating the value of the vowel, i'm going to get the value that i initially have.
02:47
And i'm going to add one to it...