gauss small
This commit is contained in:
parent
564b0cd011
commit
4241cf5260
2 changed files with 9 additions and 0 deletions
9
src/gauss.py
Executable file
9
src/gauss.py
Executable 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
0
src/greek_to_me.py
Normal file → Executable file
Loading…
Add table
Reference in a new issue