forked from yesiamrajeev/Hacktoberfest2025
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocs-Drivenml.py
More file actions
37 lines (29 loc) · 718 Bytes
/
Docs-Drivenml.py
File metadata and controls
37 lines (29 loc) · 718 Bytes
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
# calculator/calculations.py
def add(a, b):
"""
Compute and return the sum of two numbers.
Examples:
>>> add(4.0, 2.0)
6.0
>>> add(4, 2)
6.0
Args:
a (float): A number representing the first addend.
b (float): A number representing the second addend.
Returns:
float: Arithmetic sum of `a` and `b`.
"""
return float(a + b)
def subtract(a, b):
"""
Compute and return the difference between two numbers.
Examples:
>>> subtract(5.0, 3.0)
2.0
Args:
a (float): Minuend.
b (float): Subtrahend.
Returns:
float: Difference between `a` and `b`.
"""
return float(a - b)