Skip to content

Commit 3735e74

Browse files
added add algorithm (TheAlgorithms#1856)
* added add algorithm * Update and rename check/add.py to math/add.py Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 8bf380c commit 3735e74

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

math/add.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Just to check
3+
"""
4+
def add(a, b):
5+
"""
6+
>>> add(2, 2)
7+
4
8+
>>> add(2, -2)
9+
0
10+
"""
11+
return a + b
12+
13+
14+
if __name__ == "__main__":
15+
a = 5
16+
b = 6
17+
print(f"The sum of {a} + {b} is {sum(a, b)}")

0 commit comments

Comments
 (0)