From 62b40da917c0d5b3f90fb88e8c3f51fdeca30a6c Mon Sep 17 00:00:00 2001 From: sai Date: Wed, 2 Oct 2019 16:18:38 +0530 Subject: [PATCH 1/2] Have added subtract function --- coc_package/add.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/coc_package/add.py b/coc_package/add.py index 1a32662..1b417ef 100644 --- a/coc_package/add.py +++ b/coc_package/add.py @@ -10,3 +10,16 @@ def add(a, b): if not isinstance(a, int) or not isinstance(b, int): raise AttributeError("This function only accepts integer arguments") return a + b + + def subtract(a, b): + """ + A function that adds two integers + + :param a: (int) The first integer + :param b: (int) The second integer + :return: (int) The sum of a and b + :raises: AttributeError, if a and b are not integers + """ + if not isinstance(a, int) or not isinstance(b, int): + raise AttributeError("This function only accepts integer arguments") + return a - b From 9b714e6fd592ac83fb5013d7d2c8317bcd50b493 Mon Sep 17 00:00:00 2001 From: sai Date: Wed, 2 Oct 2019 16:22:19 +0530 Subject: [PATCH 2/2] Have added subtract function with slight correction in docs --- coc_package/add.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coc_package/add.py b/coc_package/add.py index 1b417ef..be3b95f 100644 --- a/coc_package/add.py +++ b/coc_package/add.py @@ -13,7 +13,7 @@ def add(a, b): def subtract(a, b): """ - A function that adds two integers + A function that adds subtracts integers :param a: (int) The first integer :param b: (int) The second integer