Add calculator.py with basic math functions
This commit is contained in:
parent
8326bba01d
commit
993b0ddae6
1 changed files with 18 additions and 0 deletions
18
calculator.py
Normal file
18
calculator.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
def add(a, b):
|
||||||
|
"""Return the sum of a and b."""
|
||||||
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
|
def subtract(a, b):
|
||||||
|
"""Return the difference between a and b."""
|
||||||
|
return a - b
|
||||||
|
|
||||||
|
|
||||||
|
def multiply(a, b):
|
||||||
|
"""Return the product of a and b."""
|
||||||
|
return a * b
|
||||||
|
|
||||||
|
|
||||||
|
def divide(a, b):
|
||||||
|
"""Return the division of a by b."""
|
||||||
|
return a / b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue