Skip to content

Commit 7208f16

Browse files
authored
Add simple addition algorithm
1 parent 739512a commit 7208f16

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

maths/simple_addition.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
Simple addition function.
3+
https://en.wikipedia.org/wiki/Addition
4+
"""
5+
6+
7+
def add_numbers(a: int, b: int) -> int:
8+
"""
9+
Returns the sum of two integers.
10+
11+
>>> add_numbers(2, 3)
12+
5
13+
>>> add_numbers(-1, 1)
14+
0
15+
"""
16+
return a + b
17+
18+
19+
if __name__ == "__main__":
20+
print(add_numbers(5, 7))

0 commit comments

Comments
 (0)