 Hey, welcome to the first tutorial in Out from Scratch to Python series. In this tutorial, we're going to make a text file that is going to contain a list of words and sentences that we are going to unpack in Scratch. Yes, it's a little bit cumbersome and yes, it's maybe not going to be the most exciting project that you ever worked on, but it is definitely going to help sow the seeds for you to build your understanding in Python. 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. So the very first thing that we need to do is go ahead and create a text file. So let's go and do that. If you're on a Windows machine, open up Notepad because you just need to use a text file. And if you're on a Mac like me, open up TextEdit. So I've got my text file open now and our words and sentences are going to take this particular format. So we're going to have a word and we're going to have a colon character and then we're going to have some kind of sentence. And this is going to become a little bit more clear as we move into Scratch and Python. But we basically need to use this colon character to separate out the word and the sentence. Now, since this is a spelling game for some level three, four students, for some younger students in a school, we need to have a spelling list. So I'd encourage you to make something like 10 words and sentences for this list. So let's, let's give you an example of what I mean. Let's say I'm having trouble spelling the word because. So I want to get the word because to practice, I'm going to type that word, put a colon there, I'm going to put a space. And then what I want to do is create a sentence that has the word because in it. It's very important that this sentence doesn't have any commas in it. The reason for that is when we import this into Scratch as lists, the comma is sort of used as an automatic delimiter. I'll show you what that means in a little bit. But anyway, let's get this word because into a sentence. So I'm going to surf today because the swell in the wind are perfect. You can see that I put that word because in my sentence and we've got the word because at the start. So what you'd want to go ahead and do is just say create 10 of these. You can create more if you want to. But I'm just going to go for 10 cause that is a nice round number. Now, if you're kind of struggling to come up with your words, go check out this website here, sentence.yourdictionary.com. I'm going to jump across to the browser so you can see that. Okay, so I've just entered that URL into our address bar here. And I'm going to type the word because into this field. And then I'm going to search for it. What happens is it auto generates some sentences for you. So I think he felt included because he was helping as much as we were. So this is pretty neat. The thing that you've got to watch out for here is if there are some commas in these sentences. So you can just go across here mouse over, copy the sentence, go back to your word list, write the word that you want to spell, put your colon, and then put the sentence there. So sometimes there might be some commas in here like this. So just do a search for a comma inside that file. And you can also just put a replace character there. And we want to replace with nothing there. So let's replace all of them and then the commas will be gone. So that's how you can get rid of the commas. Now I'm just going to magic this and populate this file with 10 different words and sentences. Okay, so I've got my 10 words here. My first word is dash. And you can say, should we try and make a dash for the car? Second word is bath, apologize, join, sick. I just came up with these words randomly. I think through a random word generator. Obviously use words that you're trying to spell or use words that younger students are also going to have difficulty spelling. Now that we've got our list, you need to go ahead and save it. Make sure that you just save it in a directory that you're familiar with. So if you're at home, I'm sure you know what to do. If you're at school, then maybe you save that in your student folder. That would be a good spot for it. I'm going to save it in my folder that I'm also going to be working on the scratch project in. And you can see that up on the screen here. I've got my scratch project and I've also got my text file here. If you're wondering what the scratch project is, I'm just working in the offline scratch editor and I've just saved my scratch file here. But if you're working on line scratch, then you can just work in there and keep your text file separate. The last thing I want to say about this text file is we're going to use this same text file for both scratch and Python. So that's pretty cool. We've got one data source, which is this words dot text. I'm going to use it for two different environments. So let's save this file and jump over to scratch and get these lines of this text file into scratch. Okay. So over here in scratch now, we're going to make a new list and we're going to call it lines. I'm assuming you know what lists are because you're wanting to go over into Python. So I'm not going to go over that. Okay. So we've got our lines here on the stage. What we need to do is import all those lines of that text file. So do that. We right click and we import. We navigate to that text file and we click open and but a bing, but a boom. We've got all those lines as a list items in our lines list here. I'm just going to jump back over to the text file and I'm going to put a comma in here. Now I'm going to save it. I'm just going to delete all of these files here and we're going to import get that words dot text file and open it and nothing actually happened. And I think this is a bug with the offline version where that comma is actually going to break it all. If you're working in the online version, what would happen is it would truncate on the lines. I'll show you what that means. So just bear in mind that we've got the comma after should here. So I'm just going to get rid of that comma now and save it. Import that list back into scratch and but a bing, but a boom. We've got it all back in here now. But in the online version, it would truncate from that comma. So what that means, it would just delete all of that text after should because it uses a comma as a delimiter. And what is that fancy word delimiter that I've said a couple of times? It is just something that we use to separate out items in a list. So you may have come across like a comma separated values file like a CSV. And basically each value is separated by a comma in those list items. So a delimiter is just something that we use to separate items. And for us, I just randomly chosen a colon character here. Cool. So just make sure that all your lines don't have any commas in it. So I think we'll park this tutorial here. So they don't get too long and unwieldy. So in this tutorial, we created a text file and we imported it into scratch. So following along with this same format and that's what we'll get stuck into into the next tutorial where we'll go through one of these lines and we will start to figure out how we can separate the word and the sentence. I look forward to catching you in that one.