12th Function Chap 4 Working With Function Book Notes
12th Function Chap 4 Working With Function Book Notes
(b) * operator
2. Which file must be part of the folder containing Python module files to make it importable python
package?
(c) __init__.py
3. In python which is the correct method to load a module math?
(d) .py
3. What is a package ? How is a package different from module ?
9. In which order Python looks for the function/module names used by you.
10. What is the usage of help( ) and dir( ) functions.
13. Why should the from import statement be avoided to import objects ?
14. What do you understand by standard library of Python ?
15. Explain the difference between import and from import statements, with examples.
2. A function checkMain( ) defined in module Allchecks.py is being used in two different programs. In
program 1 as
In program 1, the import statement must have been
import Allchecks
while in program 2, it must have been
from Allchecks import checkMain
6. Suppose that after .we import the random module, we define the following function called diff in a Python
session :
7. What are the possible outcome(s) executed from the following code ? Also specify the maximum and
minimum values that can be assigned to variable NUMBER.
11. What are the possible outcome(s) executed from the following code ? Also specify the maximum and
minimum values that can be assigned to variable PICKER.
10. Consider the following package
Back Exercise Part C
1. Create a module lengthconversion.py that stores functions for various lengths conversion e.g.,
help(lengthconversion) displays
2. Create a module MassConversion.py that stores function for mass conversion e.g.,
help(MassConversion) displays
3. Create a package from above two modules as this :