From c4ea506acf5d4b013d8c3304a6f2d6080d0f97f1 Mon Sep 17 00:00:00 2001 From: Michele Sessa Date: Tue, 24 Jan 2023 11:33:22 +0000 Subject: [PATCH] docs(numerical_operations): change position of optional section --- .../devops/numerical_operations/README.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/subjects/devops/numerical_operations/README.md b/subjects/devops/numerical_operations/README.md index 164f5bce2..e71cd0bfd 100644 --- a/subjects/devops/numerical_operations/README.md +++ b/subjects/devops/numerical_operations/README.md @@ -12,6 +12,30 @@ Create a file `numerical_operations.py` containing the following functions: We assume that `a` and `b` are numbers (`int` or `float`). +### Usage + +Here is a possible `test.py` to test your functions: + +```python +import numerical_operations + +print(numerical_operations.add(2, 2)) +print(numerical_operations.subtract(10, 5)) +print(numerical_operations.multiply(3, 4)) +print(numerical_operations.power(3, 3)) +print(numerical_operations.square(3)) +``` + +```bash +$ python test.py +4 +5 +12 +27 +9 +$ +``` + ### [Optional] Use a virtual environnement to run python code locally Virtual environments can help you to run your code locally. @@ -38,30 +62,6 @@ Python 3.10.4 > We advise you to create one virtual environment per python project. Later, we could also install external packages on our environment. -### Usage - -Here is a possible `test.py` to test your functions: - -```python -import numerical_operations - -print(numerical_operations.add(2, 2)) -print(numerical_operations.subtract(10, 5)) -print(numerical_operations.multiply(3, 4)) -print(numerical_operations.power(3, 3)) -print(numerical_operations.square(3)) -``` - -```bash -$ python test.py -4 -5 -12 -27 -9 -$ -``` - ### Hints - You could `import math` at the start of your file to use the functions defined in that library (for example `math.sqrt()`).