1 00:00:00,720 --> 00:00:02,190 - [Instructor] In this self check exercise 2 00:00:02,190 --> 00:00:04,940 I'd like you to use some of the techniques we demonstrated 3 00:00:04,940 --> 00:00:07,340 in the preceding video, 4 00:00:07,340 --> 00:00:11,400 to locate all words starting with t in the string, 5 00:00:11,400 --> 00:00:13,770 to be or not to be that is the question. 6 00:00:13,770 --> 00:00:15,560 So go ahead and create that loop 7 00:00:15,560 --> 00:00:16,490 and make sure it works, 8 00:00:16,490 --> 00:00:18,403 and then come back to see my answer. 9 00:00:23,920 --> 00:00:26,260 Okay, let's go ahead and reveal that answer. 10 00:00:26,260 --> 00:00:28,870 As you can see here, we created a for loop 11 00:00:28,870 --> 00:00:32,500 that is going to assign to the target variable 12 00:00:33,420 --> 00:00:36,046 the result of this expression, 13 00:00:36,046 --> 00:00:39,100 to be or not to be that is the question dot split. 14 00:00:39,100 --> 00:00:41,850 So as you may recall, the split method is going 15 00:00:41,850 --> 00:00:46,203 to break apart the string into individual tokens 16 00:00:46,203 --> 00:00:48,790 by default at the whitespace characters 17 00:00:48,790 --> 00:00:51,700 and that will give me back a list of strings. 18 00:00:51,700 --> 00:00:53,730 For every word in that list, 19 00:00:53,730 --> 00:00:55,270 we're going to check the word 20 00:00:55,270 --> 00:00:58,290 to see if it starts with the letter lowercase t 21 00:00:58,290 --> 00:01:00,400 and if so, we will print that word, 22 00:01:00,400 --> 00:01:02,780 separated from the next by a space. 23 00:01:02,780 --> 00:01:04,660 So if I go ahead and execute that, 24 00:01:04,660 --> 00:01:07,090 you can see we get to to that the. 25 00:01:07,090 --> 00:01:10,850 And we have to to that and the 26 00:01:10,850 --> 00:01:13,580 are the four words within the original string 27 00:01:13,580 --> 00:01:16,163 that started with a lowercase t.