In the previous course in this sequence, you saw how to define functions. For example, you saw how to define the Fahrenheit to Celsius conversion function using the def or the def command. So one way to get the function is to define yourself using def. Another way to get the functions of your code is to use the import command. So you saw in the code from helper functions, import, print LLM response or display table or other things. It turns out import is Python's command for loading in one or more functions that are stored somewhere on your computer. Let's take a look at what's actually happening under the hood with the import command. Recall that in Python, a function allows you to bundle together a chunk of code that can perform an action, and perhaps also return a value. So here was the Fahrenheit Celsius function that we define. This version prints out the answer rather then returns a value and prints out 60°F this 20°C. And throughout the course, you saw code that looked like this from helper functions import print LLM response or import something else. It turns out what Python was doing when you ran this was it was looking for a file called helper functions with extension py, which stands for Python. To load in the function print LLM response from that file. Let me show you what helper functions.py looks like. Here's code that we had written that defines a number of functions, including for example, def print LLM response. That inputs prompt and then does some processing and eventually prints out the response. This code uses a few features, a little bit more advanced than what we've gone through so far in these courses, but if you're curious, feel free to ask the AI chatbot what anything you see here that you curious about means. And ignoring most of this file for now. What we've put in this file is the definition of a function Celsius to Fahrenheit, since that Fahrenheit to Celsius with a new function Celsius to Fahrenheit that does a conversion and prints out the results over here. So is there a way to get this function into your code? Notice that if I were to write Celsius to Fahrenheit 20. This results in an error because Celsius or Fahrenheit is not currently defined. So let's ask an AI chatbot. I have a Celsius Fahrenheit function defined in the file helper functions dot py. How do I load it into my Jupyter notebook? And it says from helper functions import Celsius to Fahrenheit. Okay, let's give that a try. When I copy this code. So let me paste a code here and run it. And now if I rerun Celsius to Fahrenheit I get back a correct conversion because I've now imported from helper functions dot py this function Celsius to Fahrenheit. It turns out that Python has a few different ways to use the import command. Another one that you will see in some types of code is this. I can just say import helper functions. What this does is this will import all of the functions defined in helper functions. But then to use a function you need to call functions like this. Helper functions dot and then print LLM response. What is the capital of France? And when I type helper functions dot print LLM response, this is a way to tell Python that it should look for the print LLM response function by looking at what they had imported from helper functions.py. So if I run this, hopefully it actually works. Now let's look at one more example. If I were to call response equals get LLM response. What is the capital or France? This won't work with what I've imported so far because it doesn't know where to find the LLM response. If I were to say helper functions dot get LLM response, this will work when I can print response here if I want. But what if I don't want to include this helper functions dot here? So, one way to get this to work would be to run from helper functions import get LLM response. And if I were to do this first then it will load the get LLM response function directly so that this line of code will work. One other nifty trick if you don't want to list everything you want to import one at a time. Print LLM, response, display table, and so on. If you want to just import everything, you can say, import star, and this will import all the functions defined in helper functions.py. And because get LLM response was defined in helper functions.py this should now work. And I can print response says "Paris". I tend not to use the import star notation because it just loads a lot of functions and if you don't know what exactly is loading from helper functions, it could end up loading more functions that you intended. So I tend not to do this, but instead import only the functions that I want, such as get LLM response, print response, and so on. So I tend to do this or sometimes I'll also import helper functions like so. And again if you do only the latter then remember you to do helper functions and then dot, you know the name of the function that you want to call. So, to recap, this is how you can load functions from a file such as helper functions dot py or some other file that's saved locally on your computer. If you run from file import function, then this will look at file.py in the current working directory and import to specific function. Or if you want to import all the functions, then I recommend importing file and this will look at file.py and import all the functions there. And to call a function you need to run file dot function. And then lastly you can also run from file import star which imports every single function. But I proceed to this less often myself. In this lesson you saw how to import functions from a specific file, saved on your computer. It turns out Python also has a number of packages that we call built-in packages that it already knows about and doesn't correspond to necessarily a file in your current working directory and that doesn't need to be installed in advance. In the next video, let's take a look at how you can import functions from built-in packages. Because it turns out there are a lot of functions in these built-in packages that you will use very quickly in your code. I'll see you in the next video.