1A package is basically a directory with Python files and a file with the name __init__.py
1from pakage_name.module_name import function_name
2# now we can directly use function
3
4################################## OR ########################################
5
6from pakage_name import module_name
7# now we have to use module_name.function_name
1#use import statement to import modules
2import random
3r = random.randint(1,10)
4#use from-import statements to import functions
5from random import randint
6r = randint(1,10)
7#use from module import * statement to import all functions
8from random import *
9r = randint(1,10)