DEV Community

Can 🚀
Can 🚀

Posted on

Python // import ?

what is import ?

//Import in python is similar to #include header_file in C/C++. Python modules can get access to code from another module by importing the file/function using import. The import statement is the most common way of invoking the import machinery, but it is not the only way.

import module_name
When import is used, it searches for the module initially in the local scope by calling import() function. The value returned by the function are then reflected in the output of the initial code.

Top comments (0)