Computer Science - Class 12
Chapter 14 - Functions in python

A function checkMain() defined in module is being used in two different programs In program 1 as


and in program 2 as


Why are the functions call statements different in each program?



In program 1, the complete module ie., is imported as ‘import Allchecks’ and hence to use a specific function in the module , the  module name must be added before the function name. 

In program 2, only the required function is imported from the module as ‘ from Allchecks import checkMain( )’ and hence the function can be used independently without mentioning the module name.

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.