operations module¶
Introduction¶
Normal text can also be added in the .rst file to give more context to the automatically added documentation from the python files.
Some useful images can be added in the .rst file using the image command as shown below:
.. figure:: images/image.png
:alt: some useful image
:width: 300px
:class: with-shadow
:align: center
Image caption here.
The above code block produces the following figure.

Image caption here.¶
Operations¶
The documentation of the functions in the utils/operations.py file that was automatically generated using sphinx-apidoc command.
- operations.add(a, b)¶
This function computes the sum of the two arguments.
- Parameters
num1 (float) – first argument
num2 (float) – second argument
- Returns
sum of the two arguments
- Return type
int or float
Note
This function can accept
int
parameters too.Example:
result = add(a,b)
- operations.divide(divident, divisor)¶
This function computes the division of divident by the divisor. Reference.
- Parameters
divident (float) – divident number
divisor (float) – divisor number
- Returns
division result
- Return type
float
- Raises
ZeroDivisionError – when divisor = 0
Note
This function can accept
int
parameters too.Warning
divisor=0
will causeZeroDivisionError
exception!Example:
result = divide(a, b)