gauss small
This commit is contained in:
parent
564b0cd011
commit
4241cf5260
|
@ -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])))
|
Loading…
Reference in New Issue