gauss small

This commit is contained in:
Christoph J. Scherr 2024-03-14 16:13:58 +01:00
parent 564b0cd011
commit 4241cf5260
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
2 changed files with 9 additions and 0 deletions

9
src/gauss.py Executable file
View File

@ -0,0 +1,9 @@
import sys
def small_gaussian_sum(n: int) -> int:
return int((n**2 + n) / 2)
if __name__ == "__main__":
if sys.argv.__len__() < 2:
print("provide a natural number as arg")
else:
print(small_gaussian_sum(int(sys.argv[1])))

0
src/greek_to_me.py Normal file → Executable file
View File