-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharithmetic.py
47 lines (24 loc) · 886 Bytes
/
arithmetic.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
45
46
def add(num1, num2):
"""Returns the sum of the two inputs"""
return num1 + num2
def subtract(num1, num2):
"""Returns the second input subtracted from the first"""
return num1 - num2
def multiply(num1, num2):
"""Multiplies the two inputs together"""
return num1 * num2
def divide(num1, num2):
"""Divides the first input by the second, returning a floating point"""
return float(num1) / float(num2)
def square(num1):
"""Returns the square of the input"""
return num1 * num1
def cube(num1):
"""Returns the cube of the input"""
return num1 * num1 * num1
def power(num1, num2):
"""Raises the first input to the power of the second input and returns the value."""
return num1 ** num2
def mod(num1, num2):
"""Returns the remainder when the first input is divided by the second input."""
return num1 % num2