Once you start to advance in python import would begin to appear in your codes a lot. If not for anything else, but to link different pages (modules).
Python has two types of modules:
Built in and User defined.
Built-in modules
This are the modules that come by default with the python software.
User defined modules
This are basically created by the programmer
The main syntax is import <module name>
and it is placed at the top of the code
From........import
Sometimes when writing a code, you may just need a "section" from a module. Instead of importing the whole module, you introduce from...import.
you can also be a little extra and change the name of the function after importing it with the from...import...as




No comments:
Post a Comment