 Hey, and welcome back to our From Scratch to Python series. In the last tutorial, we managed to extract some slices of text from our lines here. We have managed to slice up a word and slice up a sentence based on the column position. In this tutorial, we're going to wrap this up and we're going to create some more custom blocks and we're going to iterate over each of these lines so we can separate the words and sentences into their own lists. Now I'm the surfing scratcher and I'm here to help curious learners just like you along on your learning journey. So let's get stuck into it in just a sec. Okay, so we've got these two code blocks here. We know that this code block extracts a word from this line and we know that this code block extracts a sentence from a line. So what I like to do since we've got some duplication going on, let's make it a custom block. I'm going to call this custom block extract word from line and we need to feed it a line that we are going to extract a word from it. So let's just leave it at that for the moment. Connect it up. We're actually going to come back and change this custom block, but I don't want to confuse you right now. So we're extracting a word from the line and what I can do is with this custom block now extract word from line, just drag it out. I'm just going to copy that line and paste it in our custom block here. So now this value of line will be equal to whatever we feed it and wherever we have that line in our custom block, we are just going to place line down in there. So now it's become a template for any line we can extract its word based on its call and position here. So we can click this. We see the output is bath. I can go down to our line eight and paste that in. Let's click it and we get noiseless now. So for any one of these lines, we can now extract a word. Pretty neat, right? Now let's do something similar for our sentence. Let's create a new custom block and we'll call it extract sentence from line. We're just going to do the exact same thing. We're going to feed it a line. Let's connect it up to that block or drag it out for testing purposes and let's just use that one, that line that we used before, that noiseless line. Cool. Do you know what to do up here in our custom block because it's still hard coded at the moment? We need to put our line parameter here, this line little template, our placeholder into wherever we see that existing line. So that's all over these positions. Now when I click this, our value of text output should be, thirdly, I got a virtually noiseless circulation. So I'm going to click this and there you go. We can see our text output has updated to the value of the sentence and that will be true for any of these that we cut and paste in. So let's just change the line. We should get I felt sick to my stomach and there we go. That is what our text output is now. But hey, we've still got some duplication going on because for any line, we want to extract its word and its sentence. So what we can do is join up these two blocks and create a new custom block. And this is going to be called split line because we want to split a line into its word and sentences. And of course, we're going to add that input. I'm going to feed it that line there. Let me just clean it up to put that colon. There we go. So we're going to split that line into a word and a sentence. So again, we can grab this out for testing purposes. Let's copy that line out there. And where will we see line? We're just going to stick that inside as a parameter to the template. The cool thing here is that we only need to set the colon position one time. So this is where I said that we're going to modify these custom blocks that we did before because we're going to add a colon position value in here. So we only need to set the colon position once we need to set the colon position for the line that we are in, which is cool. And then we won't need to do it else. So we set the colon position and we've currently got it hard coded. And this makes me a little bit nervous. So the way to get around this is to create this as a parameter as well. So we're going to extract the word from a line at the colon position. So I'm just going to right click and edit this. We're going to add in a new label and call it at colon position is what we're going to add in there. And instead of having our orange hard coded variable, we're going to have our little pink colon position there. The reason I do this is I don't like having these hard coded values inside of our functions here or my blocks. I'm okay when it's an underscore variable because that sort of tells you that we're using it as a helper variable, but this one isn't. So we're going to actually put that colon position here and we're going to feed the colon position to this custom my block. That might be a little bit confusing for you, but it's just a good practice way to keep this sort of clean. And there's something similar for our extract sentence from a line. I'm just going to right click and edit. We're going to add a label, call it at at the input of colon position there. Let's go. Okay. And let's just grab that orange colon position, replace it with the pink one and let's go down and put our colon position there. So now when we split a line, we're just going to once set the colon position of that line, we're going to extract the word and then we're going to extract the sentence. Just to give that a quick little test, let's put a weight block between these two blocks. And when we click this split line, you'll see our text output value at first be noiseless. And then after a second, it should change to thirdly I got a virtually noiseless circulation. So let's check it out. Noiseless. And thirdly, there we go. It's now flipped over to its sentence. So this is the very neat power of our custom blocks here where we can just basically wrap up all this logic into one line and we can trust that it does what it says it's going to do. This code block is going to set the colon position of this line. Then we want to extract a word from that line based on the colon position. And then we want to extract the sentence from the line based on that colon position. And we've sort of started down in the details in the nitty-gritty and we've built our way out of it. Okay, so now we've got this one beautiful block of code that splits a line into a word and into a sentence. In the next tutorial, we're going to loop through each of these lines here and we're going to extract or pass the text output of a word into a word list. And we're going to extract the text output of a sentence into a sentence list so that we can use the Google text to speak function to create our little spelling game here. So I look forward to catching you in that next one.