Now, the final, very important way to structure your report and make it more useful when using Python
is by adding modules and modules are basically different files that hold all your functions.
So we remain the file.
Don't need to have any additional functions, is there?
And you can simply import just modules inside your main file.
So I will show you how this looks like in real life.
Now let's say you have the length in centimeters and you want to convert it in meters.
So let's create a function that is doing that.
So T.F. seem to end and will take land as an input here and this whole function will return length divided
by a 100.
So we'll pass the length and centimeters when we divide it by once and we'll get the latest meters and
let's create the opposite.
So Jeff M to see you.
And then again, let's now let's try return length multiplied by 100 so it's percent one metre will
multiplied by 100 to get the value in centimeters.
OK, but what they want now is to use this function also outside of this file because that's the lesser
to me.
I would like less, less.
And like you mentioned, you could get functions that are two lines of code that's would it feasible
and possible in Python.
So what we are doing in that case, I will go here to my project and I'll double click and create the
new high def module and I will write a name in the name will be Convert.
Let's finish here, OK?
And you can see that now we are getting a convert file inside your package.
Sort this out.
So basically the modules the user need to be outside the packages in order to get the support from everywhere.
So now we'll just convert.
It doesn't care anything.
So I will simply cook this line of code and place it into the convert package and see it.
Then when we go back to the function, to our main file, then you can add this mentals by simply write
import, then the name of the file.
So convert and we import to the file.
So now we are able to use all the functions from this file.
So you can simply do that by writing convert didn't write the dot and then specify the method.
As you can see, the menus are already proposed here.
So I use centimeter to meter right in here.
I want you to specify the length so I will write 100 centimeters, which would give me one meter.
So let's print this and let's write.
And you can see that the value is one meter.
So property, you will just function nothis located in another file.
Now there was even easier way to use the functions without using the convert worked in front of every
function.
So you can write from then the name of the file convert import and then the name or the function that
you would like to import to import Netiv to something neater.
Now what it can do is simply write.
Meeta assigned Meeta without specifying the convert keyword and then write, let's say, to meet or
select, convert them to centimeters.
Let's bring this in.
You can see that two meters are equal to 200 centimeters.
So successfully used this function, that was from another file.
So that was if everything guys for just section and individual, I really hope that it was helpful for
you and it will help you to understand how to structure your code in Python and industrial ranges,
visual height and give it the like.
I really appreciate that that you spent some time with me.
Thank you very much for watching.
And I'll see you in our next coding.