The next topic is either dating through string we can use a for loop.
I did it through a string in python.
Let us take an example.
So in the Jupiter notebook I have defined a variable E which contains the text happy and then I have
declined.
Counted which count numbered all four letter B's in this variable E and then I have used a for loop
to either read through this variable.
So this is decent tax for the for loop.
So the first line means this particular line means that for every character in the variable it checks
if the character is equal to B and if this is true.
If this if this statement is true it increment the counter by 1.
And this for loop gets executed until it reaches the end of the string and then when it comes out of
the loop.
Finally the printout the number of four letter B that are found in this variable.
Happy.
So let us now execute this code in our Jupiter note book.
There are six B's that are found in this variable a.