Data is often stored as files on your computer, such as your documents or your to-do list, or your notes that maybe you've jotted down in an application like Microsoft Notepad or Mac TextEdit. I actually use an app called Obsidian to store my code to-do this, and it turns out Obsidian stores my to-do list in basically text files. Technically something called a markdown file but more or less a text file. And it turns out you can use Python to read the data, or read the text from these files so that you can write code to use AI to process the text in your own files. Let's go see how to do that. In the previous two courses, you worked with data that was created and assigned to the variables right there in the Jupyter notebook. So you saw how to create multiline strings, how to create lists and dictionaries, and you saw how you can create a list of food ingredients. In this code snippet, there is this new line from IPython display import display markdown. Don't worry about this for now. And then create a prompt using an F-string to ask a large language model to create a recipe using those ingredients, and then store the response in a variable called response. And then print this out. Let's run these two code cells. It turns out that instead of typing all the data into the notebook like this, chicken, broccoli, and rice, you can load data from a text file or maybe other other sort of file stored in your computer. Let's start by loading an email stored in a text file. decremented with uses f equals open brackets, and then quotation marks email dot text. That's the name of the file I'm going to open and read the text from. And then in quotation marks 'r' all set are read. So this will open up the file email dot text for read mode. Then email is a variable that I'm going to store the text from the file email dot Text in. And then when you're done reading a file, close it. Because this will free up some of the memory in your computer. So by running this code this just took all the text in the file email dot texts, read it and saved it in the variable email. So now we print email it prints out the value of that variable, which is an email from Daniel to me about his incredible journey around the world. This sounds like you had a lot of fun. If I open up the email dot text file using text edit, this is exactly the file that is saved. And this is what Python has read in to the Jupyter notebook here. So let's go through in detail what this code does. So the file name was email dot txt. The dot txt is a sign that this is sort as a plain text file. And so this command opens up the text file in reading mode. And it assigns this open file to the variable f. Next, email equals f dot read. Reads all of the text inside that file. And then it stores it in a string variable called email. And then when we're done, we close this file. And just as a reminder, if you are wondering what this code does exactly, you can always go to our friendly AI coding companion, to ask and you can give us this description. And if you're curious, you know what happens if I don't close a file? Then we can also give you a sense of what might happen. Now that we've loaded this text into Python and saved it in this variable email, we can use a large language model to process it. So, for example, I'm actually happy to read of the fun Daniel is having. But ever want a AI model to summarize it for me, I can write a prompt like extract bullet points for the following email and include the sender information. Here's a F-string to include the email text here. And so this is a prompt. And then if I generate a list of bullet points to summarize this email, by get a LLM response or a prompt. And then let's print the bullet points after that. Then the AI model summarizes Daniel's email for me. You notice that this output has these double asterisks, which corresponds to this word in both ways. This is a type of formatting called markdown. You can also ask our friendly AI chatbot what markdown means. If you want to display this, you can use display markdown bullet points. And this causes Python to print out this text in this nicely formatted way. And that's why at the top of the notebook, I previously imported display and markdown because I knew I was going to run them later. You learn more about this from and import commands in the fourth and final course. But for now, just remember you have to run this line of code before you use the display and the markdown functions. You don't need to print it out in this nicer format, but if you were to show it to a friend or you want to read over it more quickly yourself, you know this just makes it a bit nicer to read. So, in this video, you saw how to load one specific file email dot text. In the next lesson, we'll see how you could do this with your own text file. Let's go on to the next lesson.