Modules and libraries

el

This time we are going to see the Modules or Libraries what are those things, in simple terms they are Python files that contain definitions and statements, this ones can be imported or well created by yourself.

To import one of this modules and use it in your program is very easy, you just type “import” follow by the name of the python file (without the suffix .py). Then when you are going to use it for pi or cos(x) you have to first type the name of the module, then the pi or the cos(x). Here is an example:

modules 1

With the previous function we did with the help of the module math, we are going to use it as a module:

modules2

That’s the basic of modules and libraries, see you next time. Here i leave you a youtube tutorial maybe you understand it better with this video. #Pug#Python#Modules#Libraries#Tc101

Un comentario Agrega el tuyo

  1. Thanks for the video and the explanation! It was useful

    Me gusta

Deja un comentario