Page 281 - Computer Science Class 11 With Functions
P. 281
A Python program file is called a Python module.
If you need any help regarding the functionality of a function or class in a module, you only need to invoke Python
built-in function, help() to display the documentation of the corresponding function or class. For instance
the following statements display the help on function sqrt() of math module:
>>> import math
>>> help(math.sqrt)
Help on built-in function sqrt in module math:
sqrt(x, /)
Return the square root of x.
Similarly, we can invoke help on the entire math module as follows:
>>> help(math)
Squeezed text (285 lines).
As the math module comprises several functions and some data values like pi and e, the help on the math module
includes help on all of these functions and runs into 285 lines. You may right-click on the highlighted link to see the
details. Below, we reproduce the first and last few lines of help on the math module:
Help on built-in module math:
NAME
math
DESCRIPTION
This module provides access to the mathematical functions
defined by the C standard.
FUNCTIONS
acos(x, /)
Return the arc cosine (measured in radians) of x.
The result is between 0 and pi.
acosh(x, /)
Return the inverse hyperbolic cosine of x.
asin(x, /)
Return the arc sine (measured in radians) of x.
The result is between -pi/2 and pi/2.
…
…
…
DATA
e = 2.718281828459045
inf = inf
nan = nan
pi = 3.141592653589793
tau = 6.283185307179586
FILE
(built-in)
Modules 279

