antheiz / simple-doctest-python

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

Home Page:https://realpython.com/python-doctest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

https://realpython.com/python-doctest/


Languages

Language:Python 100.0%