Python Modules

Python modules are files containing Python definitions and statements. The filename is the module name with the suffix .py appended. Modules are used to organize code into reusable blocks.

Built-in Modules

Python comes with a large number of built-in modules that provide a wide range of functionality.

Creating Your Own Modules

You can create your own modules by creating a Python file with a .py extension.

To use a module, you can import it using the import statement.

Related Topics