User Program Communication

Import Module in Python

Used to import a module with pre-defined functions, constants, and classes.


Syntax
import module_name

#to import only a specific resource from a module
from module_name import resource_name

Notes

Modules can be in the Python standard library or self defined.


Example
from math import floor

double = 3.14
convert_to_int = floor(double)

< Write to File   |   Variable Declaration >

© 2019 SyntaxDB. All Rights Reserved.