As you see, dictionaries and lists are both useful ways to organize data. In this lesson, I'd like to go through a few fun examples about storing your friends food preferences in a list or a dictionary, or a combination of both, and then using that as data to customize a prompt to get AI to suggest recipes for your friend. This gives us a more sophisticated way to store data and use that data to customize a prompt. That fits a large language model to then generate some pretty interesting and hopefully delicious outputs. Let's take a look. So, I'm going to define the dictionary to store the food preferences of Tommy. Remember we're using curly braces here, because this is dictionary. Then the key dietary restrictions maps to the string vegetarian. Favorite ingredients maps to a list of two favorite ingredients tofu and olives. This is his experience level as a chef and maximun spice level. Six on a scale of ten. So let me run this first cell and the second cell. And you notice that the dictionary has four keys as well as four values. And the first value is a string. Second value is a list of-strings. The third value is a string, and the fourth value is just a number. Just as we saw in the previous lesson, if you want, you can print out the keys of the dictionary, and you can also print out the values of the dictionary, like so. Now, if we want to recommend the recipe for Tommy to try out, I could use a prompt like this. So this is: Please suggest a recipe that tries to include the following ingredients... And then this is f-strings f curly braces as usual for an f-string. And then food perhaps is Tommy which is the dictionary with defined up on top. Square brackets to look up the value associated with the key favorite ingredients. So this should plug in tofu and all this. Recipes should adhere dietary restrictions, the lookup Tommy's dietary restrictions, difficulty recipes should be this should be pull up the value intermediate as as experience level and then the maximum spice level on a scale of ten is six. And to provide a two-sentence description. So we run that. And if you want you can actually take a look at what this prompt looks like. And here's the prompt. And you see that all the values in the curly braces in my f-string happened. So then by pulling the right pieces of data from the food prefaces Tommy dictionary, and if we now print our response, we then end up with this: Try making a Mediterranean tofu and all the surf certify sauteed tofu with bell peppers. You know, I don't know. Sounds pretty good. And this is vegetarian. And you notice that this recipe included both tofu and olives. So we got in both of his favorite ingredients. Feel free to pause the video and plug in your own favorite ingredients and your own dietary restrictions of any and so on, and see if this gives a result to your liking. Now, let me just run through one more example of customizing this a little bit further. You notice that all the data we have so far relate to Tommy's food preferences. So, it makes sense to create a variable, in this case a dictionary to store his preferences. But if he tells us that in his kitchen he's running low on spices, except for these four: cumin, turmeric, oregano, paprika. Then we can write this prompt. And this run this to sets the available spices variable. And let's now run this to generate a new prompt. And in my f-string here, available spices gets inserted over here, which is why the prompt now looks like this. Spices. This: cumin, turmeric, oregano, paprika. And if I set recipe equals get LLM response and let's print a recipe ourselves. Then this generates say Mediterranean tofu and olive stir fry that uses well cumin, oregano and paprika and doesn't use any other spices than the ones that he says he has in his kitchen right now. So that's pretty good. In this example, I use mainly short recipes where we are set to provide a two-sentence description so you don't have too much to read. I encourage you to change the prompt to have it give you step-by-step cooking instructions, and also maybe try adding a key-value pair to the dictionary that indicates your favorite cuisine. To see if you can suggest a recipe in your favorite cuisine. And the nice thing about writing code like this is if, say, Tommy were to run out of another spice, say he uses up all of his oregano, then you could delete oregano. Rerun this, regenerate the prompts, and then with this code, have it generate a new recipe with a different set of available spices. So I encourage you to try out different variations with providing different types of data in the available spices or the food preferences Tommy. Or you can change it to your name, food preferences, your name, and see what recipes you can get. So you've learned a lot about lists and dictionaries, and how you can use them to customize prompts as a preview of what you see in the next lesson. You saw earlier that we had set food preferences Tommy, dietary restrictions to be vegetarian. It turns out that there's another way to store this data, which is if we were to say, food preferences Tommy, is Tommy vegetarian or not? True or false? And I can store a value with is vegetarian key to be associated the value true. And if I do this then food preferences. Tommy. Now it becomes a dictionary with five keys. Where it is a key is vegetarian. That's associated with a value. True. And for someone else that's not vegetarian, we could replace true with false, and a computer would know how to handle that as well. And it turns out that there are some advantages to storing some values explicitly as true false, such as if you want to make sure you really, really keep track of whether or not someone is vegetarian to make available the right food options available to them. But to learn about all this and how to compare data, which is set us up to help us make decisions, let's go on to the next video.