Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions coc_package/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 subtracts 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