/simple-doctest-python

Contoh penggunaan Doctest untuk melakukan dokumentasi dan testing pada kode python.

Primary LanguagePython

Functions to Perform Arithmetic Calculations

The calculations.py Python module provides basic arithmetic operations, including addition, subtraction, multiplication, and division.

Here are a few examples of how to use the functions in calculations.py:

>>> import calculations

>>> calculations.add(2, 2)
4.0

>>> calculations.subtract(2, 2)
0.0

>>> calculations.multiply(2, 2)
4.0

>>> calculations.divide(2, 2)
1.0

These examples show how to use the calculations.py module in your code.

You can run the test in the Markdown file using the doctest module as usual:

$ python -m doctest -v README.md