-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.py
44 lines (36 loc) · 1.02 KB
/
calculator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Calculator library containing basic math operations.
"""
def add(first_term, second_term):
"""
Add two numbers
:param first_term: first number
:param second_term: second number
:return: sum of the two numbers
"""
return first_term + second_term
def subtract(first_term, second_term):
"""
Subtract two numbers
:param first_term: first number
:param second_term: second number
:return: difference of the two numbers
"""
return first_term - second_term
def multiply(first_term, second_term):
"""
Multiply two numbers
:param first_term: first number
:param second_term: second number
:return: product of the two numbers
"""
print("Multiplying {} and {}".format(first_term, second_term))
return first_term * second_term
def divide(first_term, second_term):
"""
Divide two numbers
:param first_term: first number
:param second_term: second number
:return: quotient of the two numbers
"""
return first_term // second_term