1 00:00:00,090 --> 00:00:06,500 The next topic is either dating through string we can use a for loop. 2 00:00:06,660 --> 00:00:10,320 I did it through a string in python. 3 00:00:10,350 --> 00:00:12,410 Let us take an example. 4 00:00:13,700 --> 00:00:21,980 So in the Jupiter notebook I have defined a variable E which contains the text happy and then I have 5 00:00:21,980 --> 00:00:23,030 declined. 6 00:00:23,030 --> 00:00:33,080 Counted which count numbered all four letter B's in this variable E and then I have used a for loop 7 00:00:33,110 --> 00:00:35,240 to either read through this variable. 8 00:00:36,050 --> 00:00:40,040 So this is decent tax for the for loop. 9 00:00:40,040 --> 00:00:50,590 So the first line means this particular line means that for every character in the variable it checks 10 00:00:50,860 --> 00:00:57,020 if the character is equal to B and if this is true. 11 00:00:57,110 --> 00:01:03,050 If this if this statement is true it increment the counter by 1. 12 00:01:03,290 --> 00:01:11,040 And this for loop gets executed until it reaches the end of the string and then when it comes out of 13 00:01:11,040 --> 00:01:12,720 the loop. 14 00:01:12,810 --> 00:01:20,750 Finally the printout the number of four letter B that are found in this variable. 15 00:01:20,800 --> 00:01:21,910 Happy. 16 00:01:21,910 --> 00:01:28,370 So let us now execute this code in our Jupiter note book. 17 00:01:28,390 --> 00:01:33,610 There are six B's that are found in this variable a.